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

Broke on @swc/[email protected]: called Result::unwrap() on an Err value: LayoutError #22

Open
Tiscs opened this issue Jan 26, 2024 · 4 comments

Comments

@Tiscs
Copy link

Tiscs commented Jan 26, 2024

Hi, it’s great to learn and practice this project.

After I updated @swc/core in my vite-based project to version 1.3.106, when running vite dev, I got the following error message in the console:

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', /Users/thisen/.cargo/registry/src/github.com-1ecc6299db9ec823/rkyv-0.7.42/src/impls/core/mod.rs:266:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.272.1/src/plugin.rs:162:14:
failed to invoke plugin: failed to invoke plugin on 'Some("<project_path>/webapp/index.tsx")'

Caused by:
    0: failed to invoke `<project_path>/node_modules/@swc-jotai/debug-label/swc_jotai_debug_label.wasm` as js transform plugin at <project_path>/node_modules/@swc-jotai/debug-label/swc_jotai_debug_label.wasm
    1: RuntimeError: unreachable
More with `RUST_BACKTRACE=1`
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', /Users/thisen/.cargo/registry/src/github.com-1ecc6299db9ec823/rkyv-0.7.42/src/impls/core/mod.rs:266:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.272.1/src/plugin.rs:162:14:
failed to invoke plugin: failed to invoke plugin on 'Some("<project_path>/webapp/index.tsx")'

Caused by:
    0: failed to invoke `<project_path>/node_modules/@swc-jotai/debug-label/swc_jotai_debug_label.wasm` as js transform plugin at <project_path>/node_modules/@swc-jotai/debug-label/swc_jotai_debug_label.wasm
    1: RuntimeError: unreachable

Stack backtrace:
   0: _napi_register_module_v1
   1: _wasmer_vm_imported_memory32_atomic_notify
   2: _napi_register_module_v1
   3: _napi_register_module_v1
   4: _napi_register_module_v1
   5: _napi_register_module_v1
   6: _napi_register_module_v1
   7: _napi_register_module_v1
   8: _napi_register_module_v1
   9: <unknown>
  10: __ZZN4node14ThreadPoolWork12ScheduleWorkEvENKUlP9uv_work_sE_clES2_
  11: __ZZN4node14ThreadPoolWork12ScheduleWorkEvENUlP9uv_work_sE_8__invokeES2_
  12: _worker
  13: __pthread_joiner_wake
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
1:18:33 PM [vite] Internal server error: failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("<project_path>/webapp/index.tsx")'

Caused by:
    0: failed to invoke `<project_path>/node_modules/@swc-jotai/debug-label/swc_jotai_debug_label.wasm` as js transform plugin at <project_path>/node_modules/@swc-jotai/debug-label/swc_jotai_debug_label.wasm
    1: RuntimeError: unreachable

Stack backtrace:
   0: _napi_register_module_v1
   1: _wasmer_vm_imported_memory32_atomic_notify
   2: _napi_register_module_v1
   3: _napi_register_module_v1
   4: _napi_register_module_v1
   5: _napi_register_module_v1
   6: _napi_register_module_v1
   7: _napi_register_module_v1
   8: _napi_register_module_v1
   9: <unknown>
  10: __ZZN4node14ThreadPoolWork12ScheduleWorkEvENKUlP9uv_work_sE_clES2_
  11: __ZZN4node14ThreadPoolWork12ScheduleWorkEvENUlP9uv_work_sE_8__invokeES2_
  12: _worker
  13: __pthread_joiner_wake

Stack backtrace:
   0: _napi_register_module_v1
   1: _wasmer_vm_imported_memory32_atomic_notify
   2: <unknown>
   3: __ZZN4node14ThreadPoolWork12ScheduleWorkEvENKUlP9uv_work_sE_clES2_
   4: __ZZN4node14ThreadPoolWork12ScheduleWorkEvENUlP9uv_work_sE_8__invokeES2_
   5: _worker
   6: __pthread_joiner_wake
  Plugin: vite:react-swc
  File: <project_path>/webapp/index.tsx
  
1:18:33 PM [vite] Pre-transform error: failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("<project_path>/webapp/index.tsx")'

Caused by:
    0: failed to invoke `<project_path>/node_modules/@swc-jotai/debug-label/swc_jotai_debug_label.wasm` as js transform plugin at <project_path>/node_modules/@swc-jotai/debug-label/swc_jotai_debug_label.wasm
    1: RuntimeError: unreachable

Stack backtrace:
   0: _napi_register_module_v1
   1: _wasmer_vm_imported_memory32_atomic_notify
   2: _napi_register_module_v1
   3: _napi_register_module_v1
   4: _napi_register_module_v1
   5: _napi_register_module_v1
   6: _napi_register_module_v1
   7: _napi_register_module_v1
   8: _napi_register_module_v1
   9: <unknown>
  10: __ZZN4node14ThreadPoolWork12ScheduleWorkEvENKUlP9uv_work_sE_clES2_
  11: __ZZN4node14ThreadPoolWork12ScheduleWorkEvENUlP9uv_work_sE_8__invokeES2_
  12: _worker
  13: __pthread_joiner_wake

Stack backtrace:
   0: _napi_register_module_v1
   1: _wasmer_vm_imported_memory32_atomic_notify
   2: <unknown>
   3: __ZZN4node14ThreadPoolWork12ScheduleWorkEvENKUlP9uv_work_sE_clES2_
   4: __ZZN4node14ThreadPoolWork12ScheduleWorkEvENUlP9uv_work_sE_8__invokeES2_
   5: _worker
   6: __pthread_joiner_wake

It works fine on @swc/[email protected].

Any incompatibilities there?

Thanks.

@Tiscs
Copy link
Author

Tiscs commented Jan 29, 2024

I updated @swc/core to the latest version 1.3.107, and the problem still exists.

@gunta
Copy link

gunta commented Jan 29, 2024

Reproducing here

@gunta
Copy link

gunta commented Jan 29, 2024

Confirmed this doesn't happen with version 1.3.105

It started happening in 1.3.106 and confirmed also in 1.3.107

@nizioleque
Copy link

I am now getting this error in Next.js after updating to 14.2.0. It seems like Next.js got updated to this version of SWC and the plugin is unusable with Next.js now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants