next.js
next.js copied to clipboard
Build fails w/ swc transform "RuntimeError: unreachable"
Link to the code that reproduces this issue
https://github.com/aplr/next_swc_plugin_issue
Tested w/ 14.1.1-canary.25, 14.1.1-canary.26, 14.1.1-canary.27
To Reproduce
- Build the application
- Watch the build fail
Current vs. Expected behavior
Current: build fails Expectation: build does not fail
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000
Binaries:
Node: 21.5.0
npm: 10.2.4
Yarn: 1.22.19
pnpm: 8.14.1
Relevant Packages:
next: 14.1.1-canary.25 // Latest available version is detected (14.1.1-canary.25).
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 5.1.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
SWC transpilation
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
14.1.1-canary.15 last working version. Not working since 14.1.1-canary.16.
Error log
thread 'thread 'thread 'thread 'Result::unwrap()
on an Err
value: LayoutErrorcalled Result::unwrap()
on an Err
value: LayoutErrorResult::unwrap()
on an Err
value: LayoutError', ', ' panicked at '', called Result::unwrap()
on an Err
value: LayoutError/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.42/src/impls/core/mod.rs/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.42/src/impls/core/mod.rs/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.42/src/impls/core/mod.rs:::', 266266/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.42/src/impls/core/mod.rs:266:::6767266
:6767note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
thread '
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7:
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7: RUST_BACKTRACE=full
for a verbose backtrace.
thread '
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7:
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7: RUST_BACKTRACE=full
for a verbose backtrace.
stack backtrace:
note: Some details are omitted, run with RUST_BACKTRACE=full
for a verbose backtrace.
stack backtrace:
note: Some details are omitted, run with RUST_BACKTRACE=full
for a verbose backtrace.
thread 'Result::unwrap()
on an Err
value: LayoutError', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.42/src/impls/core/mod.rs:thread 'thread '266Result::unwrap()
on an Err
value: LayoutError67Result::unwrap()
on an Err
value: LayoutErrornote: run with RUST_BACKTRACE=1
environment variable to display a backtrace
:thread '', Result::unwrap()
on an Err
value: LayoutError:67thread '
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7: RUST_BACKTRACE=1
environment variable to display a backtrace
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
:266note: Some details are omitted, run with RUST_BACKTRACE=full
for a verbose backtrace.
:67
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
thread '
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7:
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7:
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7: RUST_BACKTRACE=full
for a verbose backtrace.
stack backtrace:
note: Some details are omitted, run with RUST_BACKTRACE=full
for a verbose backtrace.
stack backtrace:
note: Some details are omitted, run with RUST_BACKTRACE=full
for a verbose backtrace.
thread 'thread 'thread 'Result::unwrap()
on an Err
value: LayoutErrorcalled Result::unwrap()
on an Err
value: LayoutErrorcalled Result::unwrap()
on an Err
value: LayoutError', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.42/src/impls/core/mod.rs', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.42/src/impls/core/mod.rs::266266:67:',
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
67
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.42/src/impls/core/mod.rs:thread '
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7:
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7: RUST_BACKTRACE=full
for a verbose backtrace.
stack backtrace:
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
note: Some details are omitted, run with RUST_BACKTRACE=full
for a verbose backtrace.
thread '
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7: RUST_BACKTRACE=full
for a verbose backtrace.
thread 'Result::unwrap()
on an Err
value: LayoutError', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.42/src/impls/core/mod.rs:266:67
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
thread '
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7: RUST_BACKTRACE=full
for a verbose backtrace.
Failed to compile.
./node_modules/next/dist/pages/_app.js Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("/Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next/dist/pages/_app.js")'
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7:
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2:
./node_modules/next/dist/pages/_document.js Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("/Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next/dist/pages/_document.js")'
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7:
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2:
./node_modules/next/dist/pages/_error.js Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("/Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next/dist/pages/_error.js")'
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7:
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2:
Import trace for requested module: ./node_modules/next/dist/pages/_error.js
./app/now.tsx Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("/Users/andreas/Developer/playground/next_swc_plugin_issue/app/now.tsx")'
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7:
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2:
Import trace for requested module: ./app/now.tsx ./app/page.tsx
./node_modules/next/dist/client/components/error-boundary.js Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("/Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next/dist/client/components/error-boundary.js")'
Caused by:
0: failed to invoke /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
as js transform plugin at /Users/andreas/Developer/playground/next_swc_plugin_issue/node_modules/next-superjson-plugin/dist/next_superjson.wasm
1: RuntimeError: unreachable
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: _BrotliDecoderVersion
3: _BrotliDecoderVersion
4: _BrotliDecoderVersion
5: _BrotliDecoderVersion
6: _BrotliDecoderVersion
7:
Stack backtrace:
0: _napi_register_module_v1
1: _napi_register_module_v1
2: