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

Unusable template because of swc plugin #586

Open
shivam-bit opened this issue Apr 29, 2023 · 3 comments
Open

Unusable template because of swc plugin #586

shivam-bit opened this issue Apr 29, 2023 · 3 comments

Comments

@shivam-bit
Copy link

when running yarn dev i am getting following error.
Probable cause of issue - commit link
Some reference issue - formatjs/formatjs#3589

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: LayoutError', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rkyv-0.7.37/src/impls/core/mod.rs:265: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("/Users/shivam/personal-projects/tabhero-webapp/node_modules/next/dist/client/next-dev.js")'

Caused by:
    0: failed to invoke `/Users/shivam/personal-projects/tabhero-webapp/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm` as js transform plugin at /Users/shivam/personal-projects/tabhero-webapp/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm
    1: RuntimeError: call stack exhausted
    2: stk_ovf', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.260.23/src/plugin.rs:219:14
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("/Users/shivam/personal-projects/tabhero-webapp/node_modules/next/dist/client/router.js")'

Caused by:
    0: failed to invoke `/Users/shivam/personal-projects/tabhero-webapp/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm` as js transform plugin at /Users/shivam/personal-projects/tabhero-webapp/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm
    1: RuntimeError: unreachable
    2: unreachable', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.260.23/src/plugin.rs:219:14
thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/Users/shivam/personal-projects/tabhero-webapp/node_modules/next/dist/client/dev/amp-dev.js")'

Caused by:
    0: failed to invoke `/Users/shivam/personal-projects/tabhero-webapp/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm` as js transform plugin at /Users/shivam/personal-projects/tabhero-webapp/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm
    1: RuntimeError: out of bounds memory access
    2: heap_get_oob', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.260.23/src/plugin.rs:219:14
error Command failed with exit code 1.
@shivam-bit
Copy link
Author

@huv1k can you review this!

@huv1k
Copy link
Owner

huv1k commented May 23, 2023

If you need to fix it asap, you can use babel plugin for the client present, there is a bug in the SWC plugin that needs to be compiled to SWC versions. dotansimha/graphql-code-generator#9450

@johnoscott
Copy link

workaround is to remove (or comment out) these lines in next.config.js

// @ts-check

/**
 * @type {import('next').NextConfig}
 **/
module.exports = {
  reactStrictMode: true,
  images: {
    domains: ['avatars.githubusercontent.com'],
  },
  // experimental: {
  //   swcPlugins: [
  //     [
  //       '@graphql-codegen/client-preset-swc-plugin',
  //       { artifactDirectory: './src/lib/graphql/', gqlTagName: 'graphql' },
  //     ],
  //   ],
  // },
}

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