Skip to content

导入导出 nanoid 包,有问题 require() of ES modules is not supported. #3359

Closed Answered by czy88840616
zhuzeyu22 asked this question in Q&A
Discussion options

You must be logged in to vote

非问题,cjs 和 esm 不兼容,以下方案二选一

1、使用仅支持 cjs 的包,比如老版本的 nanoid
2、使用 esm 版本的框架,https://midwayjs.org/docs/esm

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@zhuzeyu22
Comment options

Answer selected by czy88840616
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
status: closed / duplicate This issue or pull request already closed or exists type: question / discussion This issue or pull request need be discussion
2 participants
Converted from issue

This discussion was converted from issue #3358 on October 26, 2023 07:16.