Closed Aloento closed 2 years ago
Just want to add to this issue that adding @rollup/plugin-commonjs
does make the error disappear for me, so it sounds like once we narrow that weird Rollup version bug down you should have a working solution to this.
For any other readers, you can do the following:
$ yarn add @rollup/plugin-commonjs
wmr.config.mjs
import { defineConfig } from 'wmr';
+import commonjs from '@rollup/plugin-commonjs';
// Full list of options: https://wmr.dev/docs/configuration
export default defineConfig({
/* Your configuration here */
alias: {
react: 'preact/compat',
'react-dom': 'preact/compat'
},
+ plugins: [commonjs()]
});
Edit: Doesn't work in dev, so not a solution.
@Aloento there's no need to create a new issue for each broken package - they're all the same issue: WMR doesn't support conditional re-exports in CommonJS modules. This affects all packages published by the React team, and a number of packages from the React community that have copied their packaging design.
Describe the bug
from
import { unstable_NormalPriority as NormalPriority, unstable_runWithPriority as runWithPriority } from 'scheduler';
in
\node_modules\@fluentui\react-context-selector\lib\createContext.js
unstable_NormalPriority
from\node_modules\scheduler\cjs\scheduler.{Env}.js
defined in\node_modules\@types\scheduler\index.d.ts
To Reproduce
yarn create wmr & yarn add @fluentui/react-components
index.js