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

Failed to parse source map from warnings #5

Closed
floriscornel opened this issue Mar 21, 2023 · 12 comments
Closed

Failed to parse source map from warnings #5

floriscornel opened this issue Mar 21, 2023 · 12 comments

Comments

@floriscornel
Copy link

Thanks for building and maintaining this library.
I'm getting source map warnings when running react-scripts start (CRA).

react version: 18.2.0
react-qr-scanner version: 1.1.4

Failed to parse source map from '/usr/src/app/node_modules/@yudiel/src/components/Counter.tsx' file: Error: ENOENT: no such file or directory, open '/usr/src/app/node_modules/@yudiel/src/components/Counter.tsx'

Failed to parse source map from '/usr/src/app/node_modules/@yudiel/src/components/Finder.tsx' file: Error: ENOENT: no such file or directory, open '/usr/src/app/node_modules/@yudiel/src/components/Finder.tsx'

Failed to parse source map from '/usr/src/app/node_modules/@yudiel/src/components/QrScanner.tsx' file: Error: ENOENT: no such file or directory, open '/usr/src/app/node_modules/@yudiel/src/components/QrScanner.tsx'

...
@yudielcurbelo
Copy link
Owner

Are you able to see this folder structure in your node_modules?

image

@yudielcurbelo
Copy link
Owner

If the warning persists, please update to 1.1.5 and let me know.

@floriscornel
Copy link
Author

@yudielcurbelo Thanks for your quick reply.
I have updated to 1.1.5, but I am still experiencing this problem.

I have found that the warning mentions:
node_modules/@yudiel/react-qr-scanner/src/utilities/isObject.ts
On my disk I can find:
node_modules/@yudiel/react-qr-scanner/dist/cjs/utilities/isObject.d.ts
and
node_modules/@yudiel/react-qr-scanner/dist/esm/utilities/isObject.d.ts

Screenshot 2023-03-22 at 09 32 42

@yudielcurbelo
Copy link
Owner

What version of node are you using, could you delete the node_modules folder and reinstall all dependencies?

@floriscornel
Copy link
Author

I am running v19.8.1 on macOS, encountered the same problem using docker image node:18.12.1-alpine.

I tried deleting node_modules and reinstalling, without success.

I have created a repo to help you reproduce the issue:
https://github.com/floriscornel/example-qr

Running commands:
npm install and npm start, for me, results in:

...
WARNING in ./node_modules/@yudiel/react-qr-scanner/dist/esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/floriscornel/Developer/example-qr/node_modules/@yudiel/react-qr-scanner/src/utilities/off.ts' file: Error: ENOENT: no such file or directory, open '/Users/floriscornel/Developer/example-qr/node_modules/@yudiel/react-qr-scanner/src/utilities/off.ts'

WARNING in ./node_modules/@yudiel/react-qr-scanner/dist/esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/floriscornel/Developer/example-qr/node_modules/@yudiel/react-qr-scanner/src/utilities/on.ts' file: Error: ENOENT: no such file or directory, open '/Users/floriscornel/Developer/example-qr/node_modules/@yudiel/react-qr-scanner/src/utilities/on.ts'

webpack compiled with 14 warnings
Files successfully emitted, waiting for typecheck results...
Issues checking in progress...
No issues found.

@yudielcurbelo
Copy link
Owner

This is something specific to CRA #mswjs/msw#1030 (comment)

I do not distribute the src file in the library, but doing so should fix the issue. I will give it a try.

@yudielcurbelo
Copy link
Owner

Please update to 1.1.6 and let me know if everything is working correctly.

@floriscornel
Copy link
Author

@yudielcurbelo Thank you.
I have confirmed that the warnings are no longer present after updating to version 1.1.6.

@short-dsb
Copy link

@yudielcurbelo Can you make this fix for the 2.0.0-beta version as well?

@Havock94
Copy link

Havock94 commented Apr 3, 2024

I updated react-qr-scanner from 1.1.9 to 1.2.10 and the warnings reappeared. Going back to version 1.1.9 "solves" the problem.

@yudielcurbelo
Copy link
Owner

There is a new beta 2.0.0-beta.8 with a lot of changes. If the issue is not fixed here, I can add the src folder to the build output.

@tvriya
Copy link

tvriya commented Sep 18, 2024

I'm getting this error in the latest version 2.0.8. Is there any solution for that?

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

No branches or pull requests

5 participants