react-blurhash icon indicating copy to clipboard operation
react-blurhash copied to clipboard

Failed to parse source map from '../node_modules/react-blurhash/src/Blurhash.tsx' file

Open BearCooder opened this issue 2 years ago • 6 comments

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

BearCooder avatar Aug 03 '22 13:08 BearCooder

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

dpvdberg avatar Aug 23 '22 11:08 dpvdberg

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 https://github.com/facebook/create-react-app/discussions/11767#discussioncomment-1969071

BearCooder avatar Oct 12 '22 20:10 BearCooder

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

BearCooder avatar Oct 19 '22 12:10 BearCooder

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

Does the problem exist for 0.2.0?

Thisen avatar Nov 08 '22 10:11 Thisen

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.

harshil1712 avatar Nov 08 '22 12:11 harshil1712

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: https://github.com/facebook/create-react-app/discussions/11767#discussioncomment-1969071

BearCooder avatar Nov 08 '22 15:11 BearCooder

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

Amal-R-Jayakumar avatar Jan 05 '23 01:01 Amal-R-Jayakumar

Please try out 0.3.0.

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

Thisen avatar Jan 09 '23 08:01 Thisen

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

BearCooder avatar Jan 11 '23 19:01 BearCooder

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 ?

Alfredroshan555 avatar Feb 24 '23 09:02 Alfredroshan555

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

BearCooder avatar Mar 06 '23 11:03 BearCooder