andrey-skl / ng-annotate-loader

Webpack loader to annotate angular applications
MIT License
120 stars 28 forks source link

Webpack cannot find module after source-map upgrade from 0.4.2 to 0.4.3 #6

Closed andrey-skl closed 9 years ago

andrey-skl commented 9 years ago

Error exist only with karma-webpack plugin in tests. Error: Cannot find module

tylerdmace commented 9 years ago

Recieved a similar issue:

ERROR in ./application.js
Module build failed: Error: "../application.js" is not in the SourceMap.
    at SourceMapConsumer_sourceContentFor [as sourceContentFor] (/home/tyler/Desktop/myapp/node_modules/source-map/lib/source-map/source-map-consumer.js:677:15)
    at SourceMapGenerator.<anonymous> (/home/tyler/Desktop/myapp/node_modules/source-map/lib/source-map/source-map-generator.js:233:42)
    at Array.forEach (native)
    at SourceMapGenerator_applySourceMap [as applySourceMap] (/home/tyler/Desktop/myapp/node_modules/source-map/lib/source-map/source-map-generator.js:232:34)
    at Object.module.exports (/home/tyler/Desktop/myapp/node_modules/ng-annotate-loader/loader.js:47:17)
andrey-skl commented 9 years ago

@tylerdmace You error is different as I see. Can you try to use source-map 0.4.2 manually?

davydkov commented 9 years ago

Got the same problem with 0.4.3. After downgrade to 0.4.2 everything works fine.

andrey-skl commented 9 years ago

version 0.0.5 published with fixed 0.4.2 source-map version

Avien commented 9 years ago

Still not working

andrey-skl commented 9 years ago

@Avien can you please try to downgrade to ng-annotate-loader@0.0.4 and try again? Would it fix that?

davydkov commented 9 years ago

0.0.5 works fine.

Avien commented 9 years ago

Downgraded to 0.0.4:

ERROR in ./src/app/app.js Module build failed: Error: "../app.js" is not in the SourceMap. at SourceMapConsumer_sourceContentFor as sourceContentFor at SourceMapGenerator. (/Users/avi/SVN/afs/exchange-ui/node_modules/ng-annotate-loader/node_modules/source-map/lib/source-map/source-map-generator.js:233:42) at Array.forEach (native) at SourceMapGenerator_applySourceMap as applySourceMap at Object.module.exports (/Users/avi/SVN/afs/exchange-ui/node_modules/ng-annotate-loader/loader.js:47:17) @ multi main

Avien commented 9 years ago

Same error in 0.0.5 but longer...

andrey-skl commented 9 years ago

@Avien was it worked before?

Avien commented 9 years ago

Weird, I had 0.0.4 till this morning and it worked great, after deleting my node_modules directory and reinstalling package.json it stopped working (still with 0.0.4)

davydkov commented 9 years ago

@Avien can you check what version of source-maps is installed when you run npm install?

ng-annotate-loader@0.0.5 node_modules/ng-annotate-loader
├── source-map@0.4.2 (amdefine@0.1.1)
└── loader-utils@0.2.10 (big.js@3.1.3, json5@0.4.0)

should 0.4.2

Avien commented 9 years ago

yep:

ng-annotate-loader@0.0.5 node_modules/ng-annotate-loader
├── source-map@0.4.2 (amdefine@0.1.1)
├── loader-utils@0.2.10 (big.js@3.1.3, json5@0.4.0)
└── ng-annotate@0.15.4 (tryor@0.1.2, simple-fmt@0.1.0, alter@0.2.0, simple-is@0.2.0, stringset@0.2.1, stringmap@0.2.2, stable@0.1.5, convert-source-map@0.4.1, source-map@0.1.43, acorn@0.11.0, ordered-ast-traverse@1.1.1, optimist@0.6.1)
andrey-skl commented 9 years ago

@Avien Okay. You can downgrade to 0.0.4 and fixate source-map@0.4.2 in you package json for a while.

Avien commented 9 years ago

OK it's working now, But I had to explicitly define the source-map@0.4.2 in my package.json so it would override your dependency That what you meant of course :)

Avien commented 9 years ago

Thanks!!

andrey-skl commented 9 years ago

I have reverted broking pull request, version 0.0.6 is available. @Avien please check it

Avien commented 9 years ago

It's working , thanks