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.

Error: ENOENT: no such file or directory for /node_modules/html-to-image/src/applyStyleWithOptions.ts'

See original GitHub issue

Expected Behavior

When i install the html-to-image package via npm, it should come with the src folder, which it doesnt, unless i’m doing something wrong

The html-to-image package should come with the src folder when insalled via npm

Current Behavior

Error: ENOENT: no such file or directory in /node_modules/html-to-image/src/applyStyleWithOptions.ts’

The src folder is not found, hence the ENOENT error

Possible Solution

Update the npm package to include the src folder instead of me having to manually transfer it to the node_modules folder for the package to work

Steps To Reproduce

  1. Install html-to-image npm package in React js project
  2. Use the package in your project to snapshot a HTML element via the cliient-side (in any way whatsoever)
  3. Run the project
Error Message & Stack Trace

<!-- Provide a log message if relevant -->

       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 '/tmp/build_5d01cf99/node_modules/html-to-image/src/cloneNode.ts' file: Error: ENOENT: no  such file or directory, open '/tmp/build_5d01cf99/node_modules/html-to-image/src/cloneNode.ts'

Additional Context

Your Environment

Ran the package in React js client side while trying to convert HTML element toPng Also ran the project in Heroku environment through connection via Github, the problem reoccurs in the same manner in both environments

  • html-to-image: [1.9.0]
  • OS: [e.g. Windows 10]
  • Browser: [e.g. Mozilla 97.0.2]

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:8
  • Comments:21 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
roxshivamsinghcommented, Aug 11, 2022

Replace line from package.json inside scripts,

"start": "GENERATE_SOURCEMAP=false react-scripts start"

or

Paste line inside .env file,

GENERATE_SOURCEMAP=false

It works for me. Thanks.

3reactions
tprince232commented, Oct 19, 2022

^ experiencing this issue as well, it seems as if #316 would fix it, hoping that can be merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve Nodejs: Error: ENOENT: no such file or directory
Your app is expecting to find a file at /home/embah/node/nodeapp/config/config.json but that file does not exist (which is what ENOENT ...
Read more >
Error: ENOENT: no such file or directory, open 'libtaos.so' #2255
This isn't a td-connector issue by the way, it just depends on the permissions set for the libtaos.so and other files.
Read more >
Error: ENOENT: no such file or directory, scandir ... - YouTube
nodejsError: ENOENT : no such file or directory, scandir '**/node_modules/node-sass/vendor' | Module build failed (from .
Read more >
How to fix: npm ERR! enoent ENOENT: no such file or ...
If you ever get this error, the hotfix is to follow these steps: delete node-modules folder; run command npm cache clean --force; run...
Read more >
ENOENT: no such file or directory" (Doc ID 2895246.1)
Visual Builder Studio - Version 20.10 and later: When Selecting "Optimize Application" VBS Package Job Fails With "Error: ENOENT: no such ...
Read more >

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