qld-cf / electron-react-tpl

electron12 + umi3.2 + typescript react 16.12 + redux + antDesign 4.0 + eslint tslint react-tslint脚手架, 下载即用,仅供学习参考
154 stars 36 forks source link

bug:在win10 + wsl2环境运行错误 #13

Closed SaltFish001 closed 1 year ago

SaltFish001 commented 3 years ago

win10 + wsl2(ubuntu 20.04) + x410 会一直抛同一个错误 报错信息:

[umi] (node:739) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 97)
[umi] (node:739) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: chunk of umi not found.
[umi]     at /home/saltfish/dkgy/maple-electron/node_modules/@umijs/preset-built-in/lib/plugins/commands/htmlUtils.js:104:27
[umi]     at Array.forEach (<anonymous>)
[umi]     at chunksToFiles (/home/saltfish/dkgy/maple-electron/node_modules/@umijs/preset-built-in/lib/plugins/commands/htmlUtils.js:93:14)
[umi]     at /home/saltfish/dkgy/maple-electron/node_modules/@umijs/preset-built-in/lib/plugins/commands/htmlUtils.js:188:32
[umi]     at Generator.next (<anonymous>)
[umi]     at asyncGeneratorStep (/home/saltfish/dkgy/maple-electron/node_modules/@umijs/preset-built-in/lib/plugins/commands/htmlUtils.js:62:103)
[umi]     at _next (/home/saltfish/dkgy/maple-electron/node_modules/@umijs/preset-built-in/lib/plugins/commands/htmlUtils.js:64:194)
[umi]     at runMicrotasks (<anonymous>)
[umi]     at processTicksAndRejections (internal/process/task_queues.js:97:5)
SaltFish001 commented 3 years ago

我在mabookpro上能成功启动

SaltFish001 commented 3 years ago

我解决问题了, 在 /src/render/layouts/index.ts

 ...
 // import store from '@utils/Store/'
 import store from '../utils/store'
 ...

不知道是不是linux下不支持 ‘@utils/Store' 这种语法导致。webpack 打包的时候会把它当成一个依赖,找不到,然后导致构建失败。没有生成相应的文件。就会有上面的报错

SaltFish001 commented 3 years ago

能确定是因为你'@utils/Store'大写了 S 因为wsl2大小写敏感,导致路径识别错误。macOS大小写不敏感 所以能正常运行。建议修改一下

SaltFish001 commented 3 years ago

@qld-cf

qld-cf commented 3 years ago

能确定是因为你'@utils/Store'大写了 S 因为wsl2大小写敏感,导致路径识别错误。macOS大小写不敏感 所以能正常运行。建议修改一下

收到 感谢指正