Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Named export 'cloneDeep' not found. The requested module 'lodash' is a CommonJS module, #5760

Open
Alixhan opened this issue Oct 25, 2023 · 0 comments

Comments

@Alixhan
Copy link

Alixhan commented Oct 25, 2023

import _, { isEmpty, round, cloneDeep, isUndefined } from "lodash";
^^^^^^^^^
SyntaxError: Named export 'cloneDeep' not found. The requested module 'lodash' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'lodash';
const { isEmpty, round, cloneDeep, isUndefined } = pkg;

在vitepress 生产打包时会报这个错误

应该是咱们这个库没有配置好ESM,可以参考一下 vitepress的问题
有个naive-ui库也是这个问题,已经解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant