Xesenix / xes-webpack-core

Core configuration helpers for webpack based projects.
1 stars 0 forks source link

Karma sourcemaps #1

Open Xesenix opened 6 years ago

Xesenix commented 6 years ago

Setting webpack.devtool = 'cheap-module-source-map' shows unreadable paths while debugging tests.

For example:

TypeError: undefined is not a function
  at <Jasmine>
  at MovementSystem.resolveCell (src/game-00/main.test.ts:215759:13)
  at ordered.filter.obj (src/game-00/main.test.ts:215718:42)
  ...

And without it (so probably 'cheap-eval-source-map')

TypeError: undefined is not a function
  at <Jasmine>
  at MovementSystem.resolveCell (webpack-internal:///./src/lib/game/ancient-maze/system/movement.system.ts:135:13)
  at ordered.filter.obj (webpack-internal:///./src/lib/game/ancient-maze/system/movement.system.ts:94:42)
Xesenix commented 6 years ago

This conflicts with https://reactjs.org/docs/cross-origin-errors.html more specifically this:

Some JavaScript bundlers may wrap the application code with eval statements in development. (For example Webpack will do this if devtool is set to any value containing the word “eval”.) This may cause errors to be treated as cross-origin.
Xesenix commented 5 years ago

Check if that helps: https://github.com/webpack-contrib/karma-webpack/issues/109#issuecomment-224961264