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

Plugin is exporting an API incompatible with the newest SWC and nextjs 12.2.3 #11

Closed
bmisiak opened this issue Jul 27, 2022 · 2 comments

Comments

@bmisiak
Copy link

bmisiak commented Jul 27, 2022

Hi!
Great work on the plugin, much appreciated.
I pulled it from npm, trying to use with nextjs 12.2.3, but after adding it to the SWC config I'm seeing this:

thread 'thread '<unnamed><unnamed>' panicked at 'thread '' panicked at '<unnamed>failed to invoke plugin: Missing export __transform_plugin_process_implfailed to invoke plugin: Missing export __transform_plugin_process_impl', ' panicked at '', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.205.0/src/plugin.rsfailed to invoke plugin: Missing export __transform_plugin_process_impl/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.205.0/src/plugin.rs:', :257/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.205.0/src/plugin.rs257:::14257
:note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
14
thread '<unnamed>' panicked at 'failed to invoke plugin: Missing export __transform_plugin_process_impl14', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.205.0/src/plugin.rs:257:14

thread '<unnamed>' panicked at 'failed to invoke plugin: Missing export __transform_plugin_process_impl', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.205.0/src/plugin.rs:257:14
thread '<unnamed>thread '<unnamed>' panicked at '' panicked at 'failed to invoke plugin: Missing export __transform_plugin_process_implfailed to invoke plugin: Missing export __transform_plugin_process_impl', ', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.205.0/src/plugin.rs:/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.205.0/src/plugin.rs257::25714:
14
thread '<unnamed>' panicked at 'failed to invoke plugin: Missing export __transform_plugin_process_impl', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swc-0.205.0/src/plugin.rs:257:14
2022-07-27 00:45:04.299 [error]: error  ./node_modules/next/dist/client/dev/amp-dev.js
Error: failed to process failed to invoke plugin: Missing export __transform_plugin_process_impl
> HTTP Server started on 
  • I inspected the .wasm in my node_modules and I see that it contains an export called __plugin_process_impl, but not __transform_plugin_process_impl.
  • SWC has been changing their API. Here's the switch to __transform_plugin_process_impl.
  • Can we make it work under nextjs 12.2.3? Seems to use swc_plugin_runner@0.64, which I think is from before they added the unresolved_mark param to the signature of __transform_plugin_process_impl. That would correspond to swc_plugin = "0.77.0".
  • If we could get a release compatible with nextjs 12.2.3 (swc_plugin = "0.77.0"), followed by a release with the newest version of swc_plugin (which includes changes to make the API more future proof), that would be fantastic.

Let me know if you need any real time feedback, I can hop on a discord.

@bmisiak bmisiak changed the title Missing export __transform_plugin_process_impl with nextjs 12.2.3 Plugin is exporting an API incompatible with the newest SWC and nextjs 12.2.3 Jul 27, 2022
@nissy-dev
Copy link
Owner

@bmisiak Thank you for reporting the issue 👍
I updated swc_plugin to "0.77.0" and published @nissy-dev/swc-plugin-react-native-web@0.2.3. Please try it!

@bmisiak bmisiak closed this as completed Jul 29, 2022
@bmisiak
Copy link
Author

bmisiak commented Aug 4, 2022

Thank you! Aaaand they just released 12.2.4 with SWC's improved, more future-proof API. Any chance we could get an updated release again? ;) vercel/next.js#39055

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