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

Crash when using with Next.js 13.4.1, 13.4.2 and 13.4.3 #13

Closed
ornakash opened this issue May 10, 2023 · 9 comments
Closed

Crash when using with Next.js 13.4.1, 13.4.2 and 13.4.3 #13

ornakash opened this issue May 10, 2023 · 9 comments

Comments

@ornakash
Copy link

ornakash commented May 10, 2023

Added the lines to next.config.js as mentioned in the documentation. In older versions everything worked perfectly, but for some reason it doesn't work anymore.

experimental: {
    swcPlugins: [
      ["@swc-jotai/debug-label", {}],
      ["@swc-jotai/react-refresh", {}],
    ],
  },

When I try to run my application, I am getting the following error:

PS C:\or\test-app> yarn run dev
yarn run v1.22.19
$ next dev

  • ready started server on 0.0.0.0:3000, url: http://localhost:3000
  • info Loaded env from C:\or\test-app.env.local
  • warn You have enabled experimental feature (swcPlugins) in next.config.js.
  • warn Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.

thread '' panicked at 'assertion failed: prev.start > max', C:\Users\runneradmin.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmer-compiler-3.2.1\src\engine\trap\frame_info.rs:224:9
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

  • error ./node_modules/next/dist/shared/lib/router/router.js
    Error: failed to process

Import trace for requested module:
./node_modules/next/dist/shared/lib/router/router.js

  • wait compiling...
    thread '' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', C:\Users\runneradmin.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmer-compiler-3.2.1\src\engine\trap\frame_info.rs:220:39
  • error ./node_modules/next/dist/shared/lib/router/router.js
    Error: failed to process called Result::unwrap() on an Err value: PoisonError { .. }

Import trace for requested module:
./node_modules/next/dist/shared/lib/router/router.js

Thanks in advance

@fabio-nettis
Copy link

Still happens to me using Next.js v13.4.1, tried pretty much everything. I'm seeing following error in the console output:

.thread '<unnamed>' panicked at 'assertion failed: prev.start > max', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmer-compiler-3.2.1/src/engine/trap/frame_info.rs:224:9

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmer-compiler-3.2.1/src/engine/trap/frame_info.rs:220:39

Would really appreciate if you could take a look at this. Thank you for the effort.

Comment related to #6

@KorySchneider
Copy link

KorySchneider commented May 16, 2023

I am also seeing this error, but only when putting the swc configuration in my next.config.js. When moving the configuration to .swcrc I do not get the error, but the debug-label package does not work.

@ornakash ornakash changed the title Crash when using with Next.js 13.4.1 Crash when using with Next.js 13.4.1, 13.4.2 and 13.4.3 May 21, 2023
@fabio-nettis
Copy link

@KorySchneider Thats because the .swcrc file is ignored by Next.js, only configuration that is accepted resides inside the next.config.js file.

@KorySchneider
Copy link

@fabio-nettis The readme for swc-jotai should be updated then, as it currently says to add the plugin configuration to your .swcrc file. Or does the configuration need to be added to both .swcrc and next.config.js?

https://github.com/pmndrs/swc-jotai#usage

cc @Thisen @kdy1

@KorySchneider
Copy link

Either way I am still unable to get these plugins working. Here are the logs:

thread '<unnamed>' panicked at 'assertion failed: prev.start > max', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmer-compiler-3.2.1/src/engine/trap/frame_info.rs:224:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmer-compiler-3.2.1/src/engine/trap/frame_info.rs:220:39
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmer-compiler-3.2.1/src/engine/trap/frame_info.rs:220:39
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmer-compiler-3.2.1/src/engine/trap/frame_info.rs:220:39
- error ./node_modules/.pnpm/next@13.4.2_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/shared/lib/fnv1a.js
Error: failed to process

Import trace for requested module:
./node_modules/.pnpm/next@13.4.2_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/shared/lib/fnv1a.js
./node_modules/.pnpm/next@13.4.2_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/shared/lib/bloom-filter/hashing.js
./node_modules/.pnpm/next@13.4.2_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/shared/lib/bloom-filter/base-filter.js
./node_modules/.pnpm/next@13.4.2_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/shared/lib/bloom-filter/index.js
./node_modules/.pnpm/next@13.4.2_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/shared/lib/router/router.js
- wait compiling...
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmer-compiler-3.2.1/src/engine/trap/frame_info.rs:220:39
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmer-compiler-3.2.1/src/engine/trap/frame_info.rs:220:39
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmer-compiler-3.2.1/src/engine/trap/frame_info.rs:220:39
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmer-compiler-3.2.1/src/engine/trap/frame_info.rs:220:39
- error ./node_modules/.pnpm/next@13.4.2_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/shared/lib/router/router.js
Error: failed to process called `Result::unwrap()` on an `Err` value: PoisonError { .. }

Import trace for requested module:
./node_modules/.pnpm/next@13.4.2_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/shared/lib/router/router.js

@fabio-nettis
Copy link

@KorySchneider The idea is that when using Next.js it should be added into next.config.js otherwise the .swcrc file should be used, at least thats the way I've understood it. Maybe the documentation would also benefit from a slight change of wording.

@ornakash
Copy link
Author

ornakash commented May 22, 2023

@fabio-nettis I tried to add

experimental: {
    swcPlugins: [
      ["@swc-jotai/debug-label", {}],
      ["@swc-jotai/react-refresh", {}],
    ],
  },

to next.config.js and I still get this error. Can you please elaborate on your solution with the .swcrc file?

@fabio-nettis
Copy link

@ornakash This configuration is completely valid according to the docs. But there seems to be a bug in the plugins rendering them unusable with the current next version. Henceforth the creation of this issue.

@Thisen
Copy link
Collaborator

Thisen commented May 23, 2023

This is a duplicate of #11.

Same issue as here: wasmerio/wasmer#3793

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

4 participants