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

Error in Next.js 13.4.4 using the app router #36

Closed
gpoole opened this issue Jun 7, 2023 · 3 comments
Closed

Error in Next.js 13.4.4 using the app router #36

gpoole opened this issue Jun 7, 2023 · 3 comments

Comments

@gpoole
Copy link

gpoole commented Jun 7, 2023

I've used the following config with Next.js 13.4.4 and the app router:

const stailwc = require('stailwc/install')

/** @type {import('next').NextConfig} */
const nextConfig = {
  swcMinify: true,
  compiler: {
    styledComponents: true
  },
  experimental: {
    swcPlugins: [stailwc()]
  }
}

module.exports = nextConfig

I get the following error from Next trying to load a page:

- error ./node_modules/next/dist/pages/_app.js
Error: Filesystem cache is not enabled, cannot read plugin from phsyical path
@gpoole
Copy link
Author

gpoole commented Jun 7, 2023

This particular error seems to be related to vercel/next.js#50651 which seems to have changed in 13.4.* and it looks like they'll be releasing a fix soon.

I tried rolling Next.js back to 13.0.1 since that's listed as the supported version, but I'm now seeing this:

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', /home/arlyon/.cargo/registry/src/github.com-1ecc6299db9ec823/rkyv-0.7.42/src/impls/core/mod.rs:/home/arlyon/.cargo/registry/src/github.com-1ecc6299db9ec823/rkyv-0.7.42/src/impls/core/mod.rs266:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
:266:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("<removed>/node_modules/next/dist/client/app-next-dev.js")'

Caused by:
    0: failed to invoke `<removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm` as js transform plugin at <removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm
    1: RuntimeError: out of bounds memory access
    2: heap_get_oob', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.232.53/src/plugin.rs:228:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("<removed>/node_modules/next/dist/client/next-dev.js")'

Caused by:
    0: failed to invoke `<removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm` as js transform plugin at <removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm
    1: RuntimeError: out of bounds memory access
    2: heap_get_oob', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.232.53/src/plugin.rs:228:14
thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("<removed>/node_modules/next/dist/client/dev/amp-dev.js")'

Caused by:
    0: failed to invoke `<removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm` as js transform plugin at <removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm
    1: RuntimeError: call stack exhausted
    2: stk_ovf', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.232.53/src/plugin.rs:228:14
thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("<removed>/node_modules/next/dist/client/router.js")'

Caused by:
    0: failed to invoke `<removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm` as js transform plugin at <removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm
    1: RuntimeError: call stack exhausted
    2: stk_ovf', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.232.53/src/plugin.rs:228:14
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', /home/arlyon/.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 'failed to invoke plugin: failed to invoke plugin on 'Some("<removed>/node_modules/next/dist/pages/_error.js")'

Caused by:
    0: failed to invoke `<removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm` as js transform plugin at <removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm
    1: RuntimeError: call stack exhausted
    2: stk_ovf', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.232.53/src/plugin.rs:228:14
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', /home/arlyon/.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 'failed to invoke plugin: failed to invoke plugin on 'Some("<removed>/node_modules/next/dist/pages/_app.js")'

Caused by:
    0: failed to invoke `<removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm` as js transform plugin at <removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm
    1: RuntimeError: call stack exhausted
    2: stk_ovf', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.232.53/src/plugin.rs:228:14
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', /home/arlyon/.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 'failed to invoke plugin: failed to invoke plugin on 'Some("<removed>/node_modules/next/dist/pages/_app.js")'

Caused by:
    0: failed to invoke `<removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm` as js transform plugin at <removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm
    1: RuntimeError: call stack exhausted
    2: stk_ovf', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.232.53/src/plugin.rs:228:14
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', /home/arlyon/.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 'failed to invoke plugin: failed to invoke plugin on 'Some("<removed>/node_modules/next/dist/pages/_error.js")'

Caused by:
    0: failed to invoke `<removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm` as js transform plugin at <removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm
    1: RuntimeError: call stack exhausted
    2: stk_ovf', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.232.53/src/plugin.rs:228:14
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', /home/arlyon/.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 'failed to invoke plugin: failed to invoke plugin on 'Some("<removed>/node_modules/next/dist/pages/_document.js")'

Caused by:
    0: failed to invoke `<removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm` as js transform plugin at <removed>/node_modules/stailwc/target/wasm32-wasi/release/stailwc.wasm
    1: RuntimeError: call stack exhausted
    2: stk_ovf', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.232.53/src/plugin.rs:228:14

I'm running macOS Monterey 12.6.3 on an M1 Mac.

@gpoole gpoole changed the title Error with Next.js 13 when using the app router Error in Next.js 13.4.4 using the app router Jun 7, 2023
@arlyon
Copy link
Owner

arlyon commented Jun 9, 2023

Hi! I am assuming you are using the default emotion engine, which currently is not supported with serverside rendering using the app router. Please see this for more info. emotion-js/emotion#2928

If you decide to use client side rendering, I am releasing a new version today (0.17.0) and have verified that all the examples work so have a look at the readme on master for the relevant versions (or the examples) and let me know if they work for you.

@gpoole
Copy link
Author

gpoole commented Jun 10, 2023

Hi @arlyon! I'm using styled components on this project and as far as I can tell emotion shouldn't have been enabled.

I've tried installing Next 13.4.3 following the latest readme and it all works now. I'm not sure what the issue could have been though, since I'm certain I tried that version of Next before opening this issue. I'll close since it's fixed now.

Thanks for following up and thanks for your work on this project!

@gpoole gpoole closed this as completed Jun 10, 2023
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

2 participants