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

Missing export __get_transform_plugin_core_pkg_diag #28

Closed
cellulosa opened this issue Sep 10, 2022 · 6 comments
Closed

Missing export __get_transform_plugin_core_pkg_diag #28

cellulosa opened this issue Sep 10, 2022 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@cellulosa
Copy link

Describe the bug

When enabling the plugin the terminal returns:

thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/Users/.../node_modules/next/dist/client/next-dev.js")'

Caused by:
    Missing export __get_transform_plugin_core_pkg_diag', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs:216: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/.../node_modules/next/dist/client/dev/amp-dev.js")'

Caused by:
    Missing export __get_transform_plugin_core_pkg_diag', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs:216:14
thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/Users/.../node_modules/next/dist/client/router.js")'

Caused by:
    Missing export __get_transform_plugin_core_pkg_diag', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs:216:14
thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/Users/.../src/pages/_app.tsx")'

Caused by:
    Missing export __get_transform_plugin_core_pkg_diag', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs:216:14
thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/Users/.../node_modules/next/dist/pages/_error.js")'

Caused by:
    Missing export __get_transform_plugin_core_pkg_diag', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs:216:14
thread 'thread '<unnamed>' panicked at '<unnamed>failed to invoke plugin: failed to invoke plugin on 'Some("/Users/.../src/pages/_app.tsx")'

Caused by:
    Missing export __get_transform_plugin_core_pkg_diag' panicked at '', failed to invoke plugin: failed to invoke plugin on 'Some("/Users/.../src/pages/_document.tsx")'

Caused by:
    Missing export __get_transform_plugin_core_pkg_diag/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs', :/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs:216216::1414

thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/Users/.../node_modules/next/dist/pages/_error.js")'

Caused by:
    Missing export __get_transform_plugin_core_pkg_diag', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs:216:14
error - ./node_modules/next/dist/client/dev/amp-dev.js
Error: failed to process failed to invoke plugin: failed to invoke plugin on 'Some("/Users/.../node_modules/next/dist/client/dev/amp-dev.js")'

Caused by:
    Missing export __get_transform_plugin_core_pkg_diag

Expected behavior

Not throw error

Reproduction link

No response

Version

0.4.1

Config

/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  experimental: {
    swcPlugins: [['next-superjson-plugin', {}]],
  },
};

module.exports = nextConfig;

Additional context

Next 12.3.0

@cellulosa cellulosa added the bug Something isn't working label Sep 10, 2022
@orionmiz
Copy link
Collaborator

It seems to be an error from breaking changes of SWC (Found in here)

Fixing this error by updating the plugin was successful.
However, when I tested the plugin in Next.js 12.3, another error message has come out

After doing some research, I found that the new error is also related to SWC.
I will try to contact the maintainer of SWC as soon as possible.

Please wait for bringing a solution.

Thanks for reporting an issue!

@orionmiz orionmiz added this to the v0.4.2 milestone Sep 15, 2022
@cdbattags
Copy link

Any update here? Eager to give this a try!

@orionmiz
Copy link
Collaborator

Plugin v0.4.2 is released!

Tested working on Next.js v12.3.1-canary.2 (It should be bigger than v12.3.0)

Try it!

@boatmeme
Copy link

Works great for me. Thank you @orionmiz!

@rayandrew
Copy link

Hi @orionmiz,

I still have problems with Macbook Air M2.

This is the only error message that I had when running next dev

Caused by:
    0: failed to invoke `/Users/rayandrew/Projects/web-monorepo/node_modules/.pnpm/next-superjson-plugin@0.4.2_vc747sktxxakxjmvmp76wxv6ju/node_modules/next-superjson-plugin/next_superjson.wasm` as js transform plugin at /Users/rayandrew/Projects/web-monorepo/node_modules/.pnpm/next-superjson-plugin@0.4.2_vc747sktxxakxjmvmp76wxv6ju/node_modules/next-superjson-plugin/next_superjson.wasm
    1: RuntimeError: out of bounds memory access
    2: heap_get_oob', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs:216:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@orionmiz
Copy link
Collaborator

orionmiz commented Sep 17, 2022

@rayandrew

Found using old version of swc in the error logs:

2: heap_get_oob', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.224.0/src/plugin.rs:216:14

Seems like you used the version of next.js lower than v12.3.1-canary.2

Don't forget v0.4.2 ensures working only over v12.3.0 (It means canary release currently)

You can update to the canary with this command:

pnpm add next@canary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants