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

在vite中使用出现开发环境与生产环境表现不一致的问题 #1261

Open
Mrcxt opened this issue Nov 21, 2023 · 2 comments
Open

Comments

@Mrcxt
Copy link

Mrcxt commented Nov 21, 2023

  • Browser Version or Node Version: Chrome
  • ali-oss Version: 6.18.1
  • Mini Showcase Repository:
  • Network Resoponse Header x-oss-request-id:

vite:v4.4.9
ali-oss:v6.18.1

问题:

通过 import * as Oss from 'ali-oss' 的方式导入项目,在开发环境中可以正常 new Oss(),但是打包之后,Oss却变成了一个esmodule对象,导致new Oss报错。

@YunZZY
Copy link
Collaborator

YunZZY commented Nov 28, 2023

看下打包时有没有对CJS模块进行转换呢

@haotian0812
Copy link

我也遇到了同样的问题,请问你解决了吗?

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

No branches or pull requests

3 participants