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

ReSVG rust package throwing error #265

Open
MickL opened this issue Oct 5, 2024 · 3 comments
Open

ReSVG rust package throwing error #265

MickL opened this issue Oct 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@MickL
Copy link

MickL commented Oct 5, 2024

🐛 The bug

When working on og images often I run into everything crashing so the DevTools are no more accessible and reloading the page does no better. This means while composing og images (which is not easy due to limitations of Satori) I need to restart the Nuxt dev process over and over again. Sometimes I make changes, restart Nuxt, make change, restart Nuxt, and so on ...

I would be nice if when something crashes not the whole DevTools go down and I could reload the page and everything is fine again or (better) after a file change everything works again.

For example, if I just place three images <img src="/images/1.jpg" /> that are 1500px wide each, everything crashes:

thread '<unnamed>' panicked at /Users/runner/.cargo/git/checkouts/resvg-4b7e4ee32ad6d954/3495d87/crates/resvg/src/geom.rs:27:61:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5

 ERROR  [unhandledRejection] socket hang up 
 at Socket.socketOnEnd (node:_http_client:516:23)
 at Socket.emit (node:events:531:35)
 at endReadableNT (node:internal/streams/readable:1696:12)
 at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Image

🛠️ To reproduce

🌈 Expected behavior

Catch errors and keep the process alive

ℹ️ Additional context

No response

@MickL MickL added the bug Something isn't working label Oct 5, 2024
@MickL
Copy link
Author

MickL commented Oct 5, 2024

I upgrade to 3.x, seems to be more forgiving overall but same behavior, crashes with same errors

@MickL MickL closed this as completed Oct 5, 2024
@MickL MickL reopened this Oct 5, 2024
@harlan-zw
Copy link
Collaborator

This seems to be an issue with the ReSVG wasm crashing the node instance, are you able to provide a reproduction?

It may come down to a Node version or OS issue.

@PGimenez
Copy link

I'm having the same issue when building a static Nuxt site. It crashes with this error

thread '<unnamed>' panicked at /Users/runner/.cargo/git/checkouts/resvg-4b7e4ee32ad6d954/3495d87/crates/resvg/src/geom.rs:27:61:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:        0x11fcfc584 - _napi_register_module_v1
   1:        0x11fba53e8 - <unknown>
   2:        0x11fcdc15c - _napi_register_module_v1
   3:        0x11fcfde18 - _napi_register_module_v1
   4:        0x11fcfd5f8 - _napi_register_module_v1
   5:        0x11fcfe65c - _napi_register_module_v1
   6:        0x11fcfe0fc - _napi_register_module_v1
   7:        0x11fcfe08c - _napi_register_module_v1
   8:        0x11fcfe080 - _napi_register_module_v1
   9:        0x11fdcf6d0 - _napi_register_module_v1
  10:        0x11fdcf7f8 - _napi_register_module_v1
  11:        0x11fc61d10 - _napi_register_module_v1
  12:        0x11fc64cdc - _napi_register_module_v1
  13:        0x11fc61788 - _napi_register_module_v1
  14:        0x11fc6153c - _napi_register_module_v1
  15:        0x11fc64250 - _napi_register_module_v1
  16:        0x11fc64d1c - _napi_register_module_v1
  17:        0x11fc61a30 - _napi_register_module_v1
  18:        0x11fc64cdc - _napi_register_module_v1
  19:        0x11fc61788 - _napi_register_module_v1
  20:        0x11fc6153c - _napi_register_module_v1
  21:        0x11fb8200c - <unknown>
  22:        0x11fb84cf4 - <unknown>
  23:        0x104af66bc - __ZN6v8impl12_GLOBAL__N_123FunctionCallbackWrapper6InvokeERKN2v820FunctionCallbackInfoINS2_5ValueEEE
fatal runtime error: failed to initiate panic, error 5
[1]    61531 abort      npm run build

I configured nitro rendering like this

nitro: {
    prerender: {
      crawlLinks: true,
      concurrency: 10,
      failOnError: false,
      static: true,
    }
  }

These are my system details

- Operating System: `Darwin`
- Node Version:     `v22.6.0`
- Nuxt Version:     `3.13.2`
- CLI Version:      `3.14.0`
- Nitro Version:    `2.9.7`
- Package Manager:  `[email protected]`
- Builder:          `-`
- User Config:      `-`
- Runtime Modules:  `-`
- Build Modules:    `-`

@harlan-zw harlan-zw changed the title Prevent DevTools from crashing completely ReSVG rust package throwing error Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants