Open heyitsarpit opened 2 years ago
I had the same issue. as a temporary fix you can assign react/jsx-runtime.js
to preact/jsx-runtime
in your next.config.js
file.
// next.config.js
webpack: (config, options) => {
if (!options.dev && !options.isServer) {
Object.assign(config.resolve.alias, {
// assign react/jsx-runtime.js to preact/jsx-runtime
'react/jsx-runtime.js': 'preact/compat/jsx-runtime',
react: 'preact/compat',
'react-dom/test-utils': 'preact/test-utils',
'react-dom': 'preact/compat',
});
}
Package subpath './compat/jsx-runtime.js' is not defined by "exports" in preact/package.json
I'm using preact in next js and tried updating to next 12, I'm using mdx-bundler which import "react/jsx-runtime" internally.
Error :
When I check the node_modules, I can see that "jsx-runtime" is inclued in the exports field.