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
I upgraded the @vitejs/plugin-legacy to version 4.0.0 and now dev server is unable to start. Error shown:
SyntaxError: Named export 'loadConfig' not found. The requested module 'browserslist' is a CommonJS module, which may not support all module.exports as named exports.
Problem lies in file index.mjs
When I changed the import { loadConfig } from 'browserlist' to:
import pkg from 'browserslist';
const { loadConfig } = pkg;
Now the dev server is able to start normally.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
I upgraded the @vitejs/plugin-legacy to version 4.0.0 and now dev server is unable to start. Error shown:
SyntaxError: Named export 'loadConfig' not found. The requested module 'browserslist' is a CommonJS module, which may not support all module.exports as named exports.
Problem lies in file index.mjs
When I changed the import { loadConfig } from 'browserlist' to:
import pkg from 'browserslist';
const { loadConfig } = pkg;
Now the dev server is able to start normally.
Reproduction
None
Steps to reproduce
Just upgrade the plugin to 4.0.0
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: