Skip to content
New issue

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

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

Already on GitHub? # to your account

typescript模板打包报错 #242

Open
kelvinXueLei opened this issue Sep 8, 2020 · 3 comments
Open

typescript模板打包报错 #242

kelvinXueLei opened this issue Sep 8, 2020 · 3 comments

Comments

@kelvinXueLei
Copy link

1、直接通过beidou init 生成一个typescript的模板。
2、运行beidou build
3、运行报错

报错信息:
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Stats

这个是什么原因?

@getchenge
Copy link

getchenge commented Sep 15, 2020

node_modules/beidou-webpack/bin/build.js:59
fs.writeFileSync(path.join(process.cwd(), '.stats'), stats);
这里改成
fs.writeFileSync(path.join(process.cwd(), '.stats'), stats.toString());
估计跟 webpack 版本有关

@kelvinXueLei
Copy link
Author

"devDependencies": {
"@types/react": "^16.4.6",
"@types/react-dom": "^16.0.11",
"@types/webpack": "^4.4.20"
},

我的版本是4.4.20,所以我需要升级webpack版本吗

@getchenge
Copy link

"devDependencies": {
"@types/react": "^16.4.6",
"@types/react-dom": "^16.0.11",
"@types/webpack": "^4.4.20"
},

我的版本是4.4.20,所以我需要升级webpack版本吗

临时解决办法就是照我前面发的,直接改下那行代码

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

No branches or pull requests

2 participants