lingui/swc-plugin

Next 13.4.3 onwards issue with swcPlugins

Closed this issue · 8 comments

TimFL commented

Hello,

as of Next 13.4.3 I'm having issues with this plugin being used in my project. I troubleshooted on a blank Next project and my current work project, with both projects having the same dependency setup.

The second I add this to my next.config:
experimental: { swcPlugins: [ [ "@lingui/swc-plugin", {} ] ] }
My project dies with the following error messages from that issue: vercel/next.js#36078 (comment)

Could this, be in any way, related to the swc Plugin? I've trialed another swc plugin and it didn't cause the issue.

Running the 4.0.0 Plugin due to the swc core issue.

According to Compatibility for next 13.4.3 you should use 4.0.1 version of plugin which is having known issue right now

Well, while i've found how to make plugin work with next@13.4.3, it still doesn't work with 13.4.4 and up. It seems nextjs broke something in plugins support. I will create a separate issue on theirs repo.

Tracking PR fixing thie issue: vercel/next.js#50651

Tested with next@13.4.5-canary.7 and @lingui/swc-plugin@v4.0.2 and it works for me.

@where-are-the-turtles it's not enought information from your comment, what and how exactly not working.

@where-are-the-turtles it's not enought information from your comment, what and how exactly not working.

there are a bunch of errors from the loader:

./node_modules/@lingui/loader/dist/index.cjs!./src/locales/pt.po
Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths.
Invalid dependencies may lead to broken watching and caching.
As best effort we try to convert all invalid values to absolute paths and converting globs into context dependencies, but this is deprecated behavior.
Loaders: Pass absolute paths to this.addDependency (existing files), this.addMissingDependency (not existing files), and this.addContextDependency (directories).
Plugins: Pass absolute paths to fileDependencies (existing files), missingDependencies (not existing files), and contextDependencies (directories).
Globs: They are not supported. Pass absolute path to the directory as context dependencies.
The following invalid values have been reported:
 * "src/locales/en.po"

it's just a warning. Just ignore it for now, it's not related to SWC plugin and already a known issue.