ngrx / core

Core functionality for the ngrx platform
MIT License
72 stars 25 forks source link

Source map issues #2

Closed xiehan closed 7 years ago

xiehan commented 8 years ago

Background: I'm using ngrx/store in my Angular2 app, which now requires this repo. I'm also using Webpack instead of SystemJS, and ES6 (transpiled using Babel) instead of Typescript.

In my karma unit testing setup, I'm using the source-map-loader Webpack plugin to optimize the stacktraces. However, @ngrx/core is causing the following warnings to be generated:

WARNING in ./~/@ngrx/core/SyncSubject.js
Cannot find source file '../../lib/SyncSubject.ts': Error: Cannot resolve 'file' or 'directory' ../../lib/SyncSubject.ts in /{REDACTED}/node_modules/@ngrx/core

WARNING in ./~/@ngrx/core/operator/select.js
Cannot find source file '../../../lib/operator/select.ts': Error: Cannot resolve 'file' or 'directory' ../../../lib/operator/select.ts in /{REDACTED}/node_modules/@ngrx/core/operator

It isn't preventing the tests from running or causing downstream problems, but I'm not having this problem with any other packages, so it seems to be specific to the way this package is set up.

I've stopped the warnings from being generated with the following settings in my Webpack config:

module: {
    preLoaders: [
        ...
        {test: /\.js$/, loader: 'source-map-loader', exclude: /(node_modules\/@ngrx\/core)/},
        ...
    ],
    ...
},

...but I figured I'd give a heads-up that I encountered this, in case anyone else runs into this in the future.

zatomik commented 8 years ago

Same issue here - also using webpack (angular2-webpack-starter). Thanks for the fix

damsorian commented 8 years ago

I have the same issue ....

brandonroberts commented 7 years ago

Sourcemap issues have been resolved