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

bug: 使用 axios 报错 util.TextEncoder is not a constructor #2183

Closed
crazyair opened this issue Aug 1, 2024 · 3 comments
Closed

bug: 使用 axios 报错 util.TextEncoder is not a constructor #2183

crazyair opened this issue Aug 1, 2024 · 3 comments

Comments

@crazyair
Copy link
Contributor

crazyair commented Aug 1, 2024

Version

latest

OS Version

mac

Node.js Version

latest

Browser Version

chrome

Link to minimal reproduction

https://github.com/crazyair/dumi-test/tree/codesandbox

Steps to reproduce

打开 http://localhost:8001/guide

What is expected?

不报错

What is actually happening?

TypeError: util.TextEncoder is not a constructor

Any additional comments? (optional)

No response

@PeachScript
Copy link
Member

@Jinbao1001 cc

@chaomingd
Copy link

chaomingd commented Aug 1, 2024

遇到同样的问题,该问题 再 2.3.x 出现的,2.2.x没有问题
似乎是模块路径解析的不对,应该导入的是 axios/dist/browser/axios.cjs
但导入了axios/dist/node/axios.cjs
image
image

@Jinbao1001
Copy link
Member

closed #2187

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

No branches or pull requests

4 participants