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 #437

Closed
JEMasonMedia opened this issue Sep 24, 2022 · 17 comments
Closed

Failed to parse source map #437

JEMasonMedia opened this issue Sep 24, 2022 · 17 comments

Comments

@JEMasonMedia
Copy link

JEMasonMedia commented Sep 24, 2022

For whatever reason, I am getting the below parse warning. It has nothing to do with my code as it only appears when I "import MDEditor from '@uiw/react-md-editor'" The library still seems to work fine, but I am not sure what to do about these major warnings.

Failed to parse source map from 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\compile.ts' file: Error: ENOENT: no such file or directory, open 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\compile.ts'

Failed to parse source map from 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\index.ts' file: Error: ENOENT: no such file or directory, open 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\index.ts'

Failed to parse source map from 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\parse.ts' file: Error: ENOENT: no such file or directory, open 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\parse.ts'

@JEMasonMedia
Copy link
Author

More info:

WARNING in ./node_modules/nth-check/lib/esm/compile.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\compile.ts' file: Error: ENOENT: no such file or directory, open 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\compile.ts'

WARNING in ./node_modules/nth-check/lib/esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\index.ts' file: Error: ENOENT: no such file or directory, open 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\index.ts'

WARNING in ./node_modules/nth-check/lib/esm/parse.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\parse.ts' file: Error: ENOENT: no such file or directory, open 'G:\Projects\folder\current\node_modules\nth-check\lib\esm\https:\raw.githubusercontent.com\fb55\nth-check\639fd2a4000b69f82350aad8c34cb43f77e483ba\src\parse.ts'

@jaywcjlove
Copy link
Member

image

https://www.npmjs.com/package/source-map-loader#user-content-examples

Some popular packages do not provide sourcemap files, which is normal, and you can configure to ignore warnings for these packages. @JEMasonMedia

https://webpack.js.org/configuration/other-options/#ignorewarnings

@JEMasonMedia
Copy link
Author

I must be missing something. I just installed the library and set up the config file, but nothing changed once I restarted the app. I used create-react-app to bootstrap my app. Could you possibly provide a little more info please?

@jaywcjlove
Copy link
Member

@JEMasonMedia I don't know why you have this error, I can't reproduce your error.

@JEMasonMedia
Copy link
Author

How to reproduce:

npx create-react-app .
npm i @uiw/react-md-editor

import the library into App.js:
import MDEditor from '@uiw/react-md-editor'

npm start

Those warnings will appear in the console.

@jaywcjlove
Copy link
Member

I reproduced this problem.

I've been using my own tools. This issue was ignored.

@JEMasonMedia

@jaywcjlove
Copy link
Member

@jaywcjlove
Copy link
Member

@jaywcjlove
Copy link
Member

image

"scripts": {
-  "start": "react-scripts start",
+  "start": "GENERATE_SOURCEMAP=false react-scripts start",
  "build": "react-scripts build",
  "test": "react-scripts test",
  "eject": "react-scripts eject"
},

@JEMasonMedia

@jaywcjlove
Copy link
Member

It was fixed by adding GENERATE_SOURCEMAP=false to the .env file.

@JEMasonMedia

@JEMasonMedia
Copy link
Author

'GENERATE_SOURCEMAP' is not recognized as an internal or external command,
operable program or batch file.

.env?

@JEMasonMedia
Copy link
Author

"scripts": {
"start": "GENERATE_SOURCEMAP=false react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},

@jaywcjlove
Copy link
Member

image

@JEMasonMedia

@JEMasonMedia
Copy link
Author

Finally googled what you were saying and got the .env workaround to work. Thank you for helping me out!

@jaywcjlove
Copy link
Member

If you are running on Windows, you need to use the compatible tool cross-env

npm install --save-dev cross-env
"start": "cross-env GENERATE_SOURCEMAP=false react-scripts start",

@JEMasonMedia Of course, the way to use .evn is not needed.

@JEMasonMedia
Copy link
Author

The .env worked on its own in windows 11. Thank you very much for your help.

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

2 participants