Sourcemaps do not work
See original GitHub issueThanks for the nice package. I have issues making sourcemaps work. I have tried adding --no-cache but I’m still getting error lines of transpiled source (or did I miss anything that console errors should be mapped to correct line?)
Here is my package.json
{
"scripts": {
"test": "jest --no-cache",
},
...
"jest": {
"globals": {
"__TS_CONFIG__": "tsconfig.test.json"
},
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/.storybook/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/.storybook/__mocks__/styleMock.js"
},
"setupFiles": [
"<rootDir>/jest.startup.js"
],
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"snapshotSerializers": [
"<rootDir>/node_modules/enzyme-to-json/serializer"
]
}
}
And here is the tsconfig.test.json
{
"compileOnSave": false,
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"lib": [
"dom",
"es2015",
"es2016"
],
"noEmitHelpers": false,
"emitDecoratorMetadata": true,
"jsx": "react",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"strictNullChecks": false,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": false,
"noUnusedParameters": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"experimentalDecorators": true,
"outDir": "./build",
"types": [
"chai",
"react"
],
"typeRoots": [
"src/typings/overrides",
"node_modules/@types"
],
"pretty": true
},
"exclude": [
"node_modules"
]
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:17 (9 by maintainers)
Top Results From Across the Web
4 Reasons Why Your Source Maps are Broken - Sentry Blog
4 Reasons Why Your Source Maps are Broken · Missing or incorrect source map directive · Missing original source files · Bad source...
Read more >Source Maps not working with Webpack - Stack Overflow
In bundle.js you will see original transpiled webpack bundle - this is normal behaviour. Open webpack:// and you will see your project files ......
Read more >web pack source map not working for some devtool options.
Sourcemap is not working for some devtool options. Tested options: eval: working ... source map should work in all devtool options.
Read more >The source maps don't work in Developer Tools when ...
When I am using the Developer Tools in the browser the javascript source map is extracted and I can debug files separately. When...
Read more >source-map-loader - webpack
Disclaimer: source-map-loader is a third-party package maintained by community members, it potentially does not have the same support, security policy or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was also struggling with broken sourcemaps, but disabling coverage made them work! I’m using Jest 24.5.0. I just changed my debug script to add
--coverage=false
and sourcemaps started working.sourcemaps are not working for me as well…