question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dev tools warnings "Failed to parse source map"

See original GitHub issue

When opening the dev tools, getting 10 warnings that all say the same. It seems this src folder is missing from the package. Only have these warnings for this package.

client:135 ./node_modules/html-to-image/es/cloneNode.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from 'C:\[redacted]\node_modules\html-to-image\src\cloneNode.ts' file: Error: ENOENT: no such file or directory, open 'C:\[redacted]\node_modules\html-to-image\src\cloneNode.ts'

Angular 10 site in Chrome.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
elmeistercommented, May 9, 2022

The source-map-loader has a setting to disable certain paths, so one can just add the following option to config\webpack.config.js and disable source maps only for html-to-image

options: {
  filterSourceMappingUrl: (url, resourcePath) => {
    if (/\/html-to-image\/.*\.js$/.test(resourcePath)) {
      return false;
    }

    return true;
  },
},
1reaction
gschattenhofercommented, Feb 22, 2022

I’ve just upgrade to react-scripts to v.5.0.0 which started using source-map-loader v3.0.1. Since then I’m seeing this warnings as well while using html-to-image v1.9.0. Any ideas?

This warnings are shown on console, I’m on macOs Monterey v12.2, node v16.14.0.

WARNING in ./node_modules/html-to-image/es/applyStyleWithOptions.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '[reacted]/node_modules/html-to-image/src/applyStyleWithOptions.ts' file: Error: ENOENT: no such file or directory, open '[reacted]/node_modules/html-to-image/src/applyStyleWithOptions.ts'

WARNING in ./node_modules/html-to-image/es/cloneNode.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '[reacted]/node_modules/html-to-image/src/cloneNode.ts' file: Error: ENOENT: no such file or directory, open '[reacted]/node_modules/html-to-image/src/cloneNode.ts'

WARNING in ./node_modules/html-to-image/es/clonePseudoElements.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '[reacted]/node_modules/html-to-image/src/clonePseudoElements.ts' file: Error: ENOENT: no such file or directory, open '[reacted]/node_modules/html-to-image/src/clonePseudoElements.ts'

WARNING in ./node_modules/html-to-image/es/embedImages.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '[reacted]/node_modules/html-to-image/src/embedImages.ts' file: Error: ENOENT: no such file or directory, open '[reacted]/node_modules/html-to-image/src/embedImages.ts'

WARNING in ./node_modules/html-to-image/es/embedResources.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '[reacted]/node_modules/html-to-image/src/embedResources.ts' file: Error: ENOENT: no such file or directory, open '[reacted]/node_modules/html-to-image/src/embedResources.ts'

WARNING in ./node_modules/html-to-image/es/embedWebFonts.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '[reacted]/node_modules/html-to-image/src/embedWebFonts.ts' file: Error: ENOENT: no such file or directory, open '[reacted]/node_modules/html-to-image/src/embedWebFonts.ts'

WARNING in ./node_modules/html-to-image/es/getBlobFromURL.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '[reacted]/node_modules/html-to-image/src/getBlobFromURL.ts' file: Error: ENOENT: no such file or directory, open '[reacted]/node_modules/html-to-image/src/getBlobFromURL.ts'

WARNING in ./node_modules/html-to-image/es/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '[reacted]/node_modules/html-to-image/src/index.ts' file: Error: ENOENT: no such file or directory, open '[reacted]/node_modules/html-to-image/src/index.ts'

WARNING in ./node_modules/html-to-image/es/util.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '[reacted]/node_modules/html-to-image/src/util.ts' file: Error: ENOENT: no such file or directory, open '[reacted]/node_modules/html-to-image/src/util.ts'

I will open a new issue if this one doesn’t get re-opened.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found