swc-project/plugins

plugin-relay crashes with 'Error while importing "env"."__get_transform_plugin_config": unknown import.'

subuta opened this issue · 3 comments

thread '' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/Users/xxx/repo/swc-relay-plugin-issue/src/index.js")'

Caused by:
0: Failed to create plugin instance
1: Error while importing "env"."__get_transform_plugin_config": unknown import. Expected Function(FunctionType { params: [I32], results: [I32] })', crates/swc/src/plugin.rs:273:14

I got this error when I try building my code with Webpack(v5) + swc-loader + plugin-relay.
It looks similar to #60. however happens with relay plugin.

I just created repository reproducing issue above. how can I make relay plugin working?

https://github.com/subuta/swc-relay-plugin-issue

Below were more detailed information about my env. let me know if any other information were necessary for reproduce.

Environments

OS

  • macOS Big Sur v11.6 (Intel iMac)
  • Node.js 16.14.2

Package versions

  • swc-loader: 0.2.3
  • @swc/plugin-relay: 1.2.5
  • @swc/core: 1.2.215 (Also tried yarn "resolutions" feature, but no luck)
kdy1 commented

Please update @swc/core

kdy1 commented

Closing as this is exactly same issue as #60

I can confirm updating @swc/core from v1.2.215 to v1.2.237 fixes issue above. I would advise you to update README of "plugin-relay" to use latest v1.2.237. Many thanks 👍

https://github.com/swc-project/plugins/blob/main/packages/relay/README.md#swcplugin-relay