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

yarn start报错 HookWebpackError: __dirname is not defined #84

Open
careteenL opened this issue Dec 2, 2021 · 4 comments
Open

yarn start报错 HookWebpackError: __dirname is not defined #84

careteenL opened this issue Dec 2, 2021 · 4 comments

Comments

@careteenL
Copy link

yarn setup
yarn start

报错信息如下:

Uncaught Error: Module build failed (from ./node_modules/@builder/pack/deps/mini-css-extract-plugin/loader.js):
HookWebpackError: __dirname is not defined
at tryRunOrWebpackError (/Users/careteen/Desktop/careteen/AppToolkit/renderer/node_modules/@builder/pack/deps/webpack/bundle5.js:67336:9)
at webpack_require_module (/Users/careteen/Desktop/careteen/AppToolkit/renderer/node_modules/@builder/pack/deps/webpack/bundle5.js:53140:12)
at nested_webpack_require_150834 (/Users/careteen/Desktop/careteen/AppToolkit/renderer/node_modules/@builder/pack/deps/webpack/bundle5.js:53097:18)
at Module. (/Users/careteen/Desktop/careteen/AppToolkit/renderer/node_modules/@builder/pack/deps/css-loader/cjs.js??ruleSet[1].rules[2].use[1]!/Users/careteen/Desktop/careteen/AppToolkit/renderer/node_modules/@builder/pack/deps/postcss-loader/cjs.js??ruleSet[1].rules[2].use[2]!/Users/careteen/Desktop/careteen/AppToolkit/renderer/node_modules/build-plugin-fusion/lib/webpackLoaders/unicodeLoader.js!/Users/careteen/Desktop/careteen/AppToolkit/renderer/node_modules/@builder/pack/deps/sass-loader/cjs.js??ruleSet[1].rules[2].use[4]!/Users/careteen/Desktop/careteen/AppToolkit/renderer/node_modules/ice-skin-loader/lib/index.js??ruleSet[1].rules[2].use[5]!/Users/careteen/Desktop/careteen/AppToolkit/renderer/src/global.scss:5:126)

screenshot-20211202-142240

@careteenL
Copy link
Author

如果将ice.js版本锁定在2.0.0则可以正常启动,但是当yarn build时又会报错

info 使用 Fusion 组件主题包: @alifd/theme-design-pro
info 离线化构建项目,自动下载网络资源,请耐心等待
info esbuild is specified as default minification
ERR! CONFIG Failed to get config.
ERR! Cannot read property 'ProgressPlugin' of undefined
TypeError: Cannot read property 'ProgressPlugin' of undefined
at new SimpleProgressPlugin (/Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/@builder/pack/deps/webpack-simple-progress-plugin/index.js:1:3316)
at /Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/@builder/pack/deps/webpack-chain/Config.js:1:20276
at Object.toConfig (/Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/@builder/pack/deps/webpack-chain/Config.js:1:21185)
at /Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/@builder/pack/deps/webpack-chain/Config.js:1:15266
at Array.map ()
at e.exports.toConfig (/Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/@builder/pack/deps/webpack-chain/Config.js:1:15257)
at /Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/@builder/user-config/lib/userConfig/polyfill.js:34:32
at configWebpack (/Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/@builder/user-config/lib/applyUserConfig.js:43:21)
at BuildService. (/Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/build-scripts/lib/core/Context.js:587:27)
at Generator.next ()
at /Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/build-scripts/lib/core/Context.js:8:71
at new Promise ()
at __awaiter (/Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/build-scripts/lib/core/Context.js:4:12)
at BuildService.runConfigWebpack (/Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/build-scripts/lib/core/Context.js:577:16)
at BuildService. (/Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/build-scripts/lib/core/Context.js:475:36)
at Generator.next ()
at fulfilled (/Users/careteen/Desktop/sohu/fe-base/FocusAppToolkit/renderer/node_modules/build-scripts/lib/core/Context.js:5:58)

screenshot-20211202-142634

@kisstar
Copy link

kisstar commented Jan 1, 2022

我也遇到了这个问题!😔

@simmzl
Copy link

simmzl commented Feb 16, 2022

+1 @luhc228

@wuwei111467
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

4 participants