2

While using sv2pdf in a project, I faced a Failed to parse source map error. I found this solution and now it's resolved. The solution was to just add GENERATE_SOURCEMAP=false to the .env file.

However, I am not sure about the possible side effects of this solution. According to the official Create React App docs, it is ignored while in development yet used in production. Am I risking something by using this?

Yahya Fati
  • 135
  • 3
  • 12

1 Answers1

3

A source map is a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger. Mozilla

When the GENERATE_SOURCEMAP is enabled a full copy of your app's source code is bundled alongside the "minified" / "transcompiled" version of JS files.

If you enable this (GENERATE_SOURCEMAP=true), the original source files will be visible to your app's visitors using tools like browser "Dev Tools".

And if you turn it off (GENERATE_SOURCEMAP=false), it won't create the source map files when you build your project (source maps are generated by default in production mode in CRA).

Positivity
  • 5,406
  • 6
  • 41
  • 61