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

TS warnings while compiling with react-scripts #310

Closed
3 tasks done
ondasStevo opened this issue Apr 24, 2024 · 4 comments
Closed
3 tasks done

TS warnings while compiling with react-scripts #310

ondasStevo opened this issue Apr 24, 2024 · 4 comments

Comments

@ondasStevo
Copy link

ondasStevo commented Apr 24, 2024

Sanity Checks

  • This is NOT about a specific MIME type⬌extension mapping. Such concerns should be addressed in the mime-db project. (Be sure to search the issues first. Odds are good your concern has already been reported.)
  • Your issue title is descriptive and specific to the problem (i.e. search-engine friendly)
  • You understand what an "MRE" is, and why providing one is important. (If not, read this)

MRE (link)

No response

MRE (supporting details)

Actual behavior: I use mime library in my react.js application. Locally for develop I use "react-scripts start" script. It generates these warnings about "No such file or directory" from mime library:
WARNING in ./node_modules/mime/dist/src/Mime.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'project_path\node_modules\mime\src\Mime.ts' file: Error: ENOENT: no such file or directory, open 'project_path\node_modules\mime\src\Mime.ts'

WARNING in ./node_modules/mime/dist/src/index.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'project_path\node_modules\mime\src\index.ts' file: Error: ENOENT: no such file or directory, open 'project_path\node_modules\mime\src\index.ts'ts'

WARNING in ./node_modules/mime/dist/types/other.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'project_path\node_modules\mime\types\other.ts' file: Error: ENOENT: no such file or directory, open 'project_path\node_modules\mime\types\other.ts'

WARNING in ./node_modules/mime/dist/types/standard.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'project_path\node_modules\mime\types\standard.ts' file: Error: ENOENT: no such file or directory, open 'project_path\node_modules\mime\types\standard.ts'

Expected behavior: start project locally without warnings generated by mime library

Dep versions for investigating:

  • react@18.2.0
  • typescript@5.4.5
  • react-scripts@5.0.1
  • mime@4.0.1
@broofa
Copy link
Owner

broofa commented Apr 24, 2024

Thanks for the report! I forgot to add the src files to the package. (Sheesh!)

Please update to mime@latest. Let me know if you're still seeing this issue and I'll reopen.

@ondasStevo
Copy link
Author

ondasStevo commented Apr 25, 2024

@broofa Thank you for fast reply, now it's better :)
Two warnings (Mime.js and index.js) are solved. After updated to mime@latest (mime@4.0.2) I got these warnings:

WARNING in ./node_modules/mime/dist/types/other.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'project_path\node_modules\mime\types\other.ts' file: Error: ENOENT: no such file or directory, open 'project_path\node_modules\mime\types\other.ts'

WARNING in ./node_modules/mime/dist/types/standard.js
Module Warning (from ./node_modules/react-scripts/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'project_path\node_modules\mime\types\standard.ts' file: Error: ENOENT: no such file or directory, open 'project_path\node_modules\mime\types\standard.ts'

So maybe an addition the types folder to the package will help.

Thanks.

@broofa
Copy link
Owner

broofa commented Apr 25, 2024

HeRe, LeT mE fIx ThAt FoR yOu ...

types dir added. Pull latest again and you should be good to go

Thanks again for the report. Sorry for the inconvenience.

@ondasStevo
Copy link
Author

Great! Now it's solved :)

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