Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source-map-loader warnings #298

Closed
CervEdin opened this issue Apr 29, 2020 · 2 comments
Closed

Source-map-loader warnings #298

CervEdin opened this issue Apr 29, 2020 · 2 comments

Comments

@CervEdin
Copy link

CervEdin commented Apr 29, 2020

Describe the bug
The source-map-loader for Webpack has trouble parsing the zxing module.

WARNING in ./node_modules/@zxing/library/esm5/core/oned/rss/expanded/decoders/AI013103decoder.js
Module Warning (from ./node_modules/source-map-loader/index.js):
(Emitted value instead of an instance of Error) Cannot find source file '../../../../../../src/core/oned/rss/expanded/decoders/AI013103decoder.ts': Error: Can't resolve '../../../../../../src/core/oned/rss/expanded/decoders/AI013103decoder.ts' in 'C:\Users\erik\repos\zxing-source-map-warning\node_modules@zxing\library\esm5\core\oned\rss\expanded\decoders'
@ ./node_modules/@zxing/library/esm5/core/oned/rss/expanded/decoders/AbstractExpandedDecoderComplement.js 7:24-52
@ ./node_modules/@zxing/library/esm5/core/oned/rss/expanded/RSSExpandedReader.js
@ ./node_modules/@zxing/library/esm5/index.js
@ ./main.ts

To Reproduce
Steps to reproduce the behavior:
git clone [email protected]:CervEdin/zxing-source-map-warning.git && cd zxing-source-map-warning/ && npm i && npx webpack

Expected behavior
I'm really not too knowledgeable about this stuff.
AFAIK it's because only the compiled .js files are in the package and not the .ts files.
Obviously, no warnings would be great.
Could probably solve that by excluding zxing from the source map loader but it'd probably be good if I could get it working in case I want to see what's going on inside the lib.

Node:

"dependencies": {
"@zxing/library": "^0.16.3",
"source-map-loader": "^0.2.4",
"ts-loader": "^7.0.1",
"typescript": "^3.8.3",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}

Additional context
Here's the same issue for another package and how they resolved it
apollographql/react-apollo#597

@CervEdin CervEdin added the bug label Apr 29, 2020
@odahcam
Copy link
Member

odahcam commented Apr 29, 2020

If you using the library from node_modules you really shouldn't be loading it's source maps. In fact, I think we shouldn't be publishing them at all in that case. If you downloaded the library source code and you are trying to compile it, I would recommend you to look into this repository build files for a how-to.

@github-actions
Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants