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

Fix unreachable source maps #11

Closed
danielbeutner opened this issue Jun 9, 2022 · 3 comments · Fixed by #12
Closed

Fix unreachable source maps #11

danielbeutner opened this issue Jun 9, 2022 · 3 comments · Fixed by #12

Comments

@danielbeutner
Copy link

Hi there,

I hope you're well!

it seems the generated source maps are pointing to src/ but the packages provides dist/.

Since I'am using CRA 5 with webpack 5, it throws these warnings:

WARNING in ./node_modules/color-helpers/dist/es/conversion.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/me/Repos/xxx/node_modules/color-helpers/src/conversion.ts' file: Error: ENOENT: no such file or directory, open '/Users/me/Repos/xxx/node_modules/color-helpers/src/conversion.ts'

WARNING in ./node_modules/color-helpers/dist/es/index.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/me/Repos/xxx/node_modules/color-helpers/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/me/Repos/xxx/node_modules/color-helpers/src/index.ts'

WARNING in ./node_modules/color-helpers/dist/es/operation.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/me/Repos/xxx/node_modules/color-helpers/src/operation.ts' file: Error: ENOENT: no such file or directory, open '/Users/me/Repos/xxx/node_modules/color-helpers/src/operation.ts'

Sending some love from the former team,

Daniel B.

@marvinhagemeister
Copy link
Owner

Hi Daniel, thanks for reaching out. Hope you're well too.

Took a look and turns out that the source maps were missing the sourcesContent property which typically holds the original source code. Just published a new version 2.0.1 with the fix.

Cheers

@danielbeutner
Copy link
Author

danielbeutner commented Jun 10, 2022

Hey @marvinhagemeister!

thank you so much. Didn't know about the sourcesContent property.

I will install the new version it right away.

Cheers, Daniel

@marvinhagemeister
Copy link
Owner

@danielbeutner No need, it was an error in this library. And the fix is included in 2.0.1. Just updating to that version should resolve it on your end 👍

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

Successfully merging a pull request may close this issue.

2 participants