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 '../node_modules/react-blurhash/src/Blurhash.tsx' file #36

Closed
BearCooder opened this issue Aug 3, 2022 · 11 comments · Fixed by #43
Closed

Comments

@BearCooder
Copy link

Hi, I used react-blurhash and when I start my project I am getting this error messages:

WARNING in ./node_modules/react-blurhash/es/Blurhash.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/BeerCoder/MyProject/store/node_modules/react-blurhash/src/Blurhash.tsx' file:
Error: ENOENT: no such file or directory, open '/home/BeerCoder/MyProject/store/node_modules/react-blurhash/src/Blurhash.tsx'
 @ ./node_modules/react-blurhash/es/index.js 1:0-49 1:0-49
 @ ./src/index.tsx 9:0-39 29:0-4
WARNING in ./node_modules/react-blurhash/es/BlurhashCanvas.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/BeerCoder/MyProject/store/node_modules/react-blurhash/src/BlurhashCanvas.tsx' file: Error: ENOENT: no such file or directory, open '/home/BeerCoder/MyProject/store/node_modules/react-blurhash/src/BlurhashCanvas.tsx'
 @ ./node_modules/react-blurhash/es/index.js 2:0-61 2:0-61
 @ ./src/index.tsx 9:0-39 29:0-4
WARNING in ./node_modules/react-blurhash/es/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/BeerCoder/MyProject/store/node_modules/react-blurhash/src/index.ts' file: Error: ENOENT: no such file or directory, open '/home/BeerCoder/MyProject/store/node_modules/react-blurhash/src/index.ts'
 @ ./src/index.tsx 9:0-39 29:0-4

I am using:

"react": "^18.2.0",
"react-blurhash": "^0.1.3",
"react-dom": "^18.2.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"typescript": "^4.7.4",

This seems to be some error in the package? @nygardk @muescha

@dpvdberg
Copy link

As per this issue,
Adding GENERATE_SOURCEMAP=false to .env worked for me.

@BearCooder
Copy link
Author

Thanks but this doesn't look like a proper solution. Preventing the use of sourcemaps is not a solution, but just hiding the initial problem.

I believe there are two ways to fix this:

  • disable sourcemap generation in this package
  • publish source code with dist files, so that source files could be actually found as the error suggests

It seems that this package may ship miss-configured sourcemaps, that interrupts the build.
According to CRA, sourcemaps should be fixed in this package and those errors are the packages fault
facebook/create-react-app#11767 (comment)

@BearCooder
Copy link
Author

Hey @nygardk @Thisen any chance for fixing this in the future? :)

@Thisen
Copy link
Collaborator

Thisen commented Nov 8, 2022

Hey @nygardk @Thisen any chance for fixing this in the future? :)

Does the problem exist for 0.2.0?

@harshil1712
Copy link

Hey @Thisen, I am using 0.2.0 and I am getting the same error. I would say that the problem still exists with this version as well.

@BearCooder
Copy link
Author

BearCooder commented Nov 8, 2022

Hey @nygardk @Thisen any chance for fixing this in the future? :)

Does the problem exist for 0.2.0?

Yes it is still there in v 0.2.0

After some googling it seems that this package may ship miss-configured sourcemaps, that interrupts the build.
According to CRA, the sourcemaps should be fixed in the package and those errors are the packages fault:
facebook/create-react-app#11767 (comment)

@Amal-R-Jayakumar
Copy link

I am facing the same issue. Would there be an update to solve the said problem?

@Thisen
Copy link
Collaborator

Thisen commented Jan 9, 2023

Please try out 0.3.0.

If that doesn't fix the issue, please reopen the issue.

@BearCooder
Copy link
Author

Hmm I tried it and it seems the issue still exists.

@Alfredroshan555
Copy link

Iam having this same issue in a React-Typescript project while trying to use a package, but the package is working fine if I close the errors in the browser,but the error message continues on the terminal.
I tried giving GENERATE_SOURCEMAP=false in the .env file in same folder as the package.json but it is still showing the error .Is there a way around this or why this particular error is popping up ?

@BearCooder
Copy link
Author

@Thisen it seems this isnt fixed, I cant reopen though

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.

6 participants