CARVIEW |
Select Language
HTTP/2 200
date: Thu, 09 Oct 2025 23:04:51 GMT
content-type: text/html; charset=utf-8
cache-control: max-age=0, private, must-revalidate
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
link: ; rel=preload; as=fetch; crossorigin=use-credentials
referrer-policy: no-referrer-when-downgrade
server-timing: issue_layout-fragment;desc="issue_layout fragment";dur=244.781693,issue_conversation_content-fragment;desc="issue_conversation_content fragment";dur=936.59076,nginx;desc="NGINX";dur=1.238925,glb;desc="GLB";dur=137.938001
strict-transport-security: max-age=31536000; includeSubdomains; preload
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With, Accept,Accept-Encoding, Accept, X-Requested-With
x-content-type-options: nosniff
x-frame-options: deny
x-voltron-version: 266d7a9
x-xss-protection: 0
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=PFrtNle3AcBAEPt9lOLU9eJYfS6LcF62OjGH8MnbT6g%2B3MnscTYs%2BisHPo0XSI9NUHJsNKeRDetapDP1mXGzwbxTM45SLbOEqoD9e22iZJdvLHUJo%2BLlrRFEPUVCvvwH8y96wkqEuUYwi36aE5KKXVPYwaBOYL0SDNNCL4e8jgDzVKQ9WQ6g3ASVoyE090wiekSuSFyA64F23DFfdtfdqzY8vF98i3cz6B6u9iJOLh1D83QvPDGbLH6QI4oYgz5ekeqYu9nasTvAbyUG2MFizA%3D%3D--eTgTPfOQq8s2OJst--NsPScEzZWfBIbAqmOkcmIg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1704628641.1760051090; Path=/; Domain=github.com; Expires=Fri, 09 Oct 2026 23:04:50 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Fri, 09 Oct 2026 23:04:50 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: EDAE:2D3FFE:10C725E:142181E:68E83F92
Difficulty debugging errors, stack traces missing and/or poor formatting Β· Issue #3296 Β· karma-runner/karma Β· GitHub
No one assignedNo labelsNo typeNo projectsNo milestoneNone yetNo branches or pull requests
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Closed
Copy link
Description
Expected behaviour
I'm hoping to see full stack traces, to aid in debugging.
Actual behaviour
I see output like the following, which is making it difficult to debug:
output:
08 04 2019 20:37:40.725:INFO [karma]: Karma v2.0.5 server started at https://0.0.0.0:9876/
08 04 2019 20:37:40.728:INFO [launcher]: Launching browser CustomElectron with unlimited concurrency
08 04 2019 20:37:40.734:INFO [launcher]: Starting browser Electron
08 04 2019 20:37:41.312:INFO [Electron 2.0.18 (Node 8.9.3)]: Connected on socket UeP2147YwI328f5pAAAA with id 20256050
Electron 2.0.18 (Node 8.9.3) ERROR LOG: 'DEPRECATION:', 'Setting specFilter directly on Env is deprecated, please use the specFilter option in `configure`'
Electron 2.0.18 (Node 8.9.3) ERROR
{
"message": "Uncaught TypeError: Cannot read property 'default' of undefined\nat /Users/trusktr/src/trusktr+infamous/src/core/ImperativeBase.js:98:129\n\nundefined",
"str": "Uncaught TypeError: Cannot read property 'default' of undefined\nat /Users/trusktr/src/trusktr+infamous/src/core/ImperativeBase.js:98:129\n\nundefined"
}
Electron 2.0.18 (Node 8.9.3): Executed 0 of 0 ERROR (0.81 secs / 0 secs)
As you can see, the only hint is line 98
, which doesn't match the original source because that line seems to be relative to transpiled code. Plus, without the stack trace it is hard to imagine what is happening.
My karma config looks like the following:
karma.config.js:
const CWD = process.cwd()
const glob = require('globby')
const fs = require('fs')
const mkdirp = require('mkdirp') // mkdir -p
const rmrf = require('rimraf') // rm -rf
const r = require('regexr').default
const testFiles = glob.sync([
CWD+'/src/**/*.test.js',
CWD+'/tests/**/*.js',
])
const config = fs.existsSync(CWD+'/builder.config.js') ? require(CWD+'/builder.config.js') : {}
rmrf.sync( CWD + '/.karma-test-build' )
testFiles.forEach(file => {
const relativeFile = file.replace(CWD, '')
const relativePath = dirname(relativeFile)
mkdirp.sync( CWD + '/.karma-test-build' + relativePath )
const nodeModulesToCompile = config.nodeModulesToCompile
fs.writeFileSync( CWD + '/.karma-test-build' + relativeFile, `
// NOTE, we don't use babel.config.js settings here, we can target a
// more modern environment.
require('@babel/register')({
presets: [ ['@babel/preset-env', { targets: { node: 9 } }] ],
plugins: [
// We need to transpile the not-yet-official re-export syntax.
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-export-default-from',
],
sourceMap: 'inline',
${config.nodeModulesToCompile ? `
ignore: [
// don't compile node_modules except for ones specified in the config
${nodeModulesToCompile.map(moduleName => {
return r`/node_modules(?!\/${r.escape(moduleName)}\/)/`
})}
],
` : ''}
})
require( '${ file }' )
` )
})
const debugMode = false
// const debugMode = true
module.exports = function(config) {
config.set({
frameworks: ['jasmine', 'stacktrace'],
reporters: ['spec'],
port: 9876, // karma web server port
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
singleRun: debugMode ? false : true,
concurrency: Infinity,
basePath: CWD,
// Set up a "CustomElectron" launcher that extends karma-electron's
// default "Electron" launcher, so that we can control options
// (docs: // https://github.com/twolfson/karma-electron/tree/5.1.1#launcher-configuration)
browsers: ['CustomElectron'],
customLaunchers: {
CustomElectron: {
base: 'Electron',
flags: debugMode ? [
// If in debug mode, this makes the electron window visible
// so that we can step through tests using devtools
'--show'
// Alternatively to the --show option, we can use this
// option, then open chrome://inspect in Google Chrome and
// inspect from there.
// '--remote-debugging-port=9222',
] : [],
}
},
files: [
'.karma-test-build/**/*.js',
],
preprocessors: {
'.karma-test-build/**/*.js': ['electron'],
},
client: {
// otherwise "require is not defined"
useIframe: false,
loadScriptsViaRequire: true,
},
})
}
function dirname(fullname) {
if (typeof fullname !== 'string') throw new TypeError('expected a string')
const parts = fullname.split('/')
parts.pop()
return parts.join('/')
}
Any ideas why the error output is so limited, or on how to make it show full stack traces? Maybe it isn't a karma problem, but a problem with a karma plugin? Thanks for any insight!
Environment Details
- Karma version (output of
karma --version
): 2.0.5 - Relevant part of your
karma.config.js
file: see above
Steps to reproduce the behaviour
git clone https://github.com/trusktr/infamous.git
cd infamous
npm install
npm test
Note, npm test
ultimately runs the script in node_modules/builder-js-package/scripts/run-karma-tests.sh
:
run-karma-tests.sh:
xvfb-maybe \
karma start ./node_modules/builder-js-package/config/karma.config.js
RESULT=$?
# remove the temporary folder
rm -rf ./.karma-test-build
exit $RESULT
So, another way in which you can run the tests directly is:
./node_modules/.bin/karma start ./node_modules/builder-js-package/config/karma.config.js
worc
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
Issue actions
You canβt perform that action at this time.