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

Support Next.js 15 #119

Closed
wyozi opened this issue Oct 22, 2024 · 9 comments · Fixed by #120
Closed

Support Next.js 15 #119

wyozi opened this issue Oct 22, 2024 · 9 comments · Fixed by #120
Labels
help wanted Extra attention is needed

Comments

@wyozi
Copy link

wyozi commented Oct 22, 2024

looks like there's swc_core incompatibilities

FATAL: An unexpected Turbopack error occurred. Please report the content of /tmp/next-panic-4786d2dffed5dd6196b728f8cfe58e06.log to https://github.com/vercel/next.js/issues/new
 ○ Compiling /instrumentation ...
thread '<unnamed>' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.44/src/impls/core/mod.rs:266:67:
called `Result::unwrap()` on an `Err` value: LayoutError
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ⨯ ./instrumentation.ts
Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("./apps/dashboard/instrumentation.ts")'

Caused by:
    0: failed to invoke `./node_modules/.pnpm/@[email protected]_@[email protected][email protected]_react@19_r7ibgrromecbkqmdrbz3xyh6hi/node_modules/@lingui/swc-plugin/target/wasm32-wasi/release/lingui_macro_plugin.wasm` as js transform plugin at ./node_modules/.pnpm/@[email protected]_@[email protected][email protected]_react@19_r7ibgrromecbkqmdrbz3xyh6hi/node_modules/@lingui/swc-plugin/target/wasm32-wasi/release/lingui_macro_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See the documentation for compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
                        
                       Note that if you want to use the os features like filesystem, you need to use `wasi`. Wasm itself does not have concept of filesystem.
                        
                       https://swc.rs/docs/plugin/selecting-swc-core
       
                       See https://plugins.swc.rs/versions/from-plugin-runner/0.115.1 for the list of the compatible versions.
                        
                       Build info: 
                           Date: 2024-10-17
                           Timestamp: 2024-10-17T09:53:58.028375000Z
                           
                       Version info: 
                           swc_plugin_runner: 0.115.1
                           Dependencies: VERGEN_IDEMPOTENT_OUTPUT
                       
    2: RuntimeError: unreachable
@andrii-bodnar andrii-bodnar added the help wanted Extra attention is needed label Oct 22, 2024
@datagutt
Copy link
Contributor

Contributed a fix for this in #120

@andrii-bodnar andrii-bodnar linked a pull request Oct 24, 2024 that will close this issue
@ephraimduncan
Copy link

I am getting a similiar error

---------------------------
Panic: panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.289.1/src/plugin.rs:169:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/duncan/dev/documenso/node_modules/next/dist/esm/shared/lib/router/utils/relativize-url.js")'

Caused by:
    0: failed to invoke `/Users/duncan/dev/documenso/node_modules/@lingui/swc-plugin/target/wasm32-wasi/release/lingui_macro_plugin.wasm` as js transform plugin at /Users/duncan/dev/documenso/node_modules/@lingui/swc-plugin/target/wasm32-wasi/release/lingui_macro_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See the documentation for compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
                        
                       Note that if you want to use the os features like filesystem, you need to use `wasi`. Wasm itself does not have concept of filesystem.
                        
                       https://swc.rs/docs/plugin/selecting-swc-core
       
                       See https://plugins.swc.rs/versions/from-plugin-runner/0.115.1 for the list of the compatible versions.
                        
                       Build info: 
                           Date: 2024-10-17
                           Timestamp: 2024-10-17T09:53:58.028375000Z
                           
                       Version info: 
                           swc_plugin_runner: 0.115.1
                           Dependencies: VERGEN_IDEMPOTENT_OUTPUT
                       
    2: RuntimeError: out of bounds memory access
Backtrace:    0: _napi_register_module_v1
   1: <unknown>
   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: _BrotliDecoderVersion
   9: _BrotliDecoderVersion
  10: <unknown>
  11: _BrotliDecoderVersion
  12: _BrotliDecoderVersion
  13: _BrotliDecoderVersion
  14: _BrotliDecoderVersion
  15: _BrotliDecoderVersion
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>

---------------------------
Panic: panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.289.1/src/plugin.rs:169:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/duncan/dev/documenso/node_modules/next/dist/pages/_app.js")'

Caused by:
    0: failed to invoke `/Users/duncan/dev/documenso/node_modules/@lingui/swc-plugin/target/wasm32-wasi/release/lingui_macro_plugin.wasm` as js transform plugin at /Users/duncan/dev/documenso/node_modules/@lingui/swc-plugin/target/wasm32-wasi/release/lingui_macro_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See the documentation for compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
                        
                       Note that if you want to use the os features like filesystem, you need to use `wasi`. Wasm itself does not have concept of filesystem.
                        
                       https://swc.rs/docs/plugin/selecting-swc-core
       
                       See https://plugins.swc.rs/versions/from-plugin-runner/0.115.1 for the list of the compatible versions.
                        
                       Build info: 
                           Date: 2024-10-17
                           Timestamp: 2024-10-17T09:53:58.028375000Z
                           
                       Version info: 
                           swc_plugin_runner: 0.115.1
                           Dependencies: VERGEN_IDEMPOTENT_OUTPUT
                       
    2: RuntimeError: out of bounds memory access
Backtrace:    0: _napi_register_module_v1
   1: <unknown>
   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: _BrotliDecoderVersion
   9: _BrotliDecoderVersion
  10: <unknown>
  11: _BrotliDecoderVersion
  12: _BrotliDecoderVersion
  13: _BrotliDecoderVersion
  14: _BrotliDecoderVersion
  15: _BrotliDecoderVersion
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>

---------------------------
Panic: panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.289.1/src/plugin.rs:169:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/duncan/dev/documenso/node_modules/next/dist/pages/_app.js")'

Caused by:
    0: failed to invoke `/Users/duncan/dev/documenso/node_modules/@lingui/swc-plugin/target/wasm32-wasi/release/lingui_macro_plugin.wasm` as js transform plugin at /Users/duncan/dev/documenso/node_modules/@lingui/swc-plugin/target/wasm32-wasi/release/lingui_macro_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See the documentation for compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
                        
                       Note that if you want to use the os features like filesystem, you need to use `wasi`. Wasm itself does not have concept of filesystem.
                        
                       https://swc.rs/docs/plugin/selecting-swc-core
       
                       See https://plugins.swc.rs/versions/from-plugin-runner/0.115.1 for the list of the compatible versions.
                        
                       Build info: 
                           Date: 2024-10-17
                           Timestamp: 2024-10-17T09:53:58.028375000Z
                           
                       Version info: 
                           swc_plugin_runner: 0.115.1
                           Dependencies: VERGEN_IDEMPOTENT_OUTPUT
                       
    2: RuntimeError: out of bounds memory access
Backtrace:    0: _napi_register_module_v1
   1: <unknown>
   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: _BrotliDecoderVersion
   9: _BrotliDecoderVersion
  10: <unknown>
  11: _BrotliDecoderVersion
  12: _BrotliDecoderVersion
  13: _BrotliDecoderVersion
  14: _BrotliDecoderVersion
  15: _BrotliDecoderVersion
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>

---------------------------
Panic: panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.289.1/src/plugin.rs:169:14:
failed to invoke plugin: failed to invoke plugin on 'Some("/Users/duncan/dev/documenso/node_modules/next/dist/pages/_app.js")'

Caused by:
    0: failed to invoke `/Users/duncan/dev/documenso/node_modules/@lingui/swc-plugin/target/wasm32-wasi/release/lingui_macro_plugin.wasm` as js transform plugin at /Users/duncan/dev/documenso/node_modules/@lingui/swc-plugin/target/wasm32-wasi/release/lingui_macro_plugin.wasm
    1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See the documentation for compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
                        
                       Note that if you want to use the os features like filesystem, you need to use `wasi`. Wasm itself does not have concept of filesystem.
                        
                       https://swc.rs/docs/plugin/selecting-swc-core
       
                       See https://plugins.swc.rs/versions/from-plugin-runner/0.115.1 for the list of the compatible versions.
                        
                       Build info: 
                           Date: 2024-10-17
                           Timestamp: 2024-10-17T09:53:58.028375000Z
                           
                       Version info: 
                           swc_plugin_runner: 0.115.1
                           Dependencies: VERGEN_IDEMPOTENT_OUTPUT
                       
    2: RuntimeError: out of bounds memory access
Backtrace:    0: _napi_register_module_v1
   1: <unknown>
   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: _BrotliDecoderVersion
   9: _BrotliDecoderVersion
  10: <unknown>
  11: _BrotliDecoderVersion
  12: _BrotliDecoderVersion
  13: _BrotliDecoderVersion
  14: _BrotliDecoderVersion
  15: _BrotliDecoderVersion
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>

@andrii-bodnar
Copy link
Contributor

Available in 4.1.0.

@datagutt
Copy link
Contributor

@andrii-bodnar Hey, could you make a similar release for 5.0.0-next as well?
I can provide a PR as well for this, but it should pretty much be a cherry pick of my commit, no?

@andrii-bodnar
Copy link
Contributor

@datagutt sure, I'll just merge the main branch into the next branch. Would it be ok if I did this tomorrow morning?

@datagutt
Copy link
Contributor

It actually seems like some of the changes in the next-branch breaks with the latest swc_core :(
I got it to compile with some changes, but some of the tests fail now.
Not too familiar with swc architecture so I might need someone with experience to look at it.

This commit is probably semi-useless, and seems a lot of formatting changes got applied (tried running cargo fmt to clean it up but that changed even more): datagutt@16589da

@timofei-iatsenko
Copy link
Collaborator

I will take a look tomorrow

@timofei-iatsenko
Copy link
Collaborator

@datagutt #122 created a PR

@andrii-bodnar
Copy link
Contributor

The new version 5.0.0-next.3 is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants