You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reactCompilerPreset() can't be used with @rolldown/plugin-babel's parallel option #1547
Cannot use the "parallel" option, because "presets[0]" cannot be sent to a worker thread. Refer to plugins and presets by module name instead of by function or object.
DataCloneError: () => ({ plugins: [[fileURLToPath(import.meta.resolve("babel-plugin-react-compiler")), options]] }) could not be cloned.
reactCompilerPreset sets preset to an inline function, which can't be sent to a worker thread. @rolldown/plugin-babel keeps rolldown.filter and the hooks on the main thread, so only preset needs to be cloneable. Shipping the preset as a module and referencing it by path with its options would make the two work together. 6.2.0 widened the peer range to ^0.3.0, so this combination looks intended.
Workaround: babel({ parallel: true, plugins: [["babel-plugin-react-compiler", opts]] }) plus optimizeDeps: { include: ["react/compiler-runtime"] }. On our app this took the build from 2.7s to 1.9s.
Activity