bubkoo / html-to-image

✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
MIT License
5.66k stars 524 forks source link

Failed to resolve the file './node_modules/html-to-image/es/util.js' #253

Closed wongsuun closed 2 years ago

wongsuun commented 2 years ago

Failed to resolve the file './node_modules/html-to-image/es/util.js'

Expected Behavior

Current Behavior

Possible Solution

Steps To Reproduce

  1. import to a javascript (name: ./src/app.js) as below: import * as htmlToImage from 'html-to-image';

  2. run command: npx parcel src/app.js

  3. Get Error as below: Server running at http://localhost:1234 ⠋ Building index.js... [Error: ENOENT: no such file or directory, open '/node_modules/html-to-image/src/util.ts'] { errno: -2, code: 'ENOENT', syscall: 'open', Server running at http://localhost:1234 🚨 Build failed.

@parcel/core: Failed to resolve 'process' from './node_modules/html-to-image/es/util.js'

/node_modules/html-to-image/es/util.js:123:21 122 | return new Promise((resolve) => canvas.toBlob(resolve)); > 123 | } > | ^ 124 | return new Promise((resolve) => { 125 | const binaryString = window.atob(canvas.toDataURL().split(',')[1]);
Error Message & Stack Trace

```txt ```

### Additional Context ### Your Environment - html-to-image: [e.g. 0.1.0] - OS: Ubuntu 18.04.6 TLS - node: v14.16.1 - npm: 6.14.12 - parcel: 2.3.1 - Browser: [e.g. chrome 78.0.3904.108]
vivcat[bot] commented 2 years ago

👋 @wongsuun

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

wongsuun commented 2 years ago

Detail steps: 1. mkdir ParcelWithHtmltoImage 2. cd ParcelWithHtmltoImage/ 3. npm init 4. npm install --save parcel html-to-image *5. echo "import as htmlToImage from 'html-to-image';" > app.js 6. npx parcel app.js**

Get Error as below:

Server running at http://localhost:1234 ⠋ Building esmodule-helpers.js... [Error: ENOENT: no such file or directory, open '/ParcelWithHtmltoImage/node_modules/html-to-image/src/util.ts'] { errno: -2, code: 'ENOENT', syscall: 'open', Server running at http://localhost:1234 🚨 Build failed.

@parcel/core: Failed to resolve 'process' from './node_modules/html-to-image/es/util.js'

/ParcelWithHtmltoImage/node_modules/html-to-image/es/util.js:123:21 122 | return new Promise((resolve) => canvas.toBlob(resolve)); > 123 | } > | ^ 124 | return new Promise((resolve) => { 125 | const binaryString = window.atob(canvas.toDataURL().split(',')[1]);
vivcat[bot] commented 2 years ago

Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

Thanks for being a part of the Antv community! 💪💯

vivcat[bot] commented 2 years ago

Hey again! It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Thanks again for being part of the Antv community! 💪💯

vivcat[bot] commented 1 year ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.