Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

main.ts没有被编译导致dev/build时失败 #19

Closed
TIS-OMiddle opened this issue Feb 25, 2021 · 2 comments
Closed

main.ts没有被编译导致dev/build时失败 #19

TIS-OMiddle opened this issue Feb 25, 2021 · 2 comments

Comments

@TIS-OMiddle
Copy link

step:任意空目录下执行

  • yarn create @umijs/umi-app
  • yarn add umi-plugin-electron-builder --dev
  • yarn electron:dev

命令行报错

ERROR in ./src/main/main.ts 8:14
  Module parse failed: Unexpected token (8:14)
  You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
  | 
  | const isDevelopment = process.env.NODE_ENV === 'development';
  > let mainWindow: BrowserWindow;
  | 
  | protocol.registerSchemesAsPrivileged([
   @ multi ./node_modules/electron-webpack/out/electron-main-hmr/main-hmr ./src/main/main.ts main[1]

electron弹出错误窗口:
screenshot-20210225-200734

看起来像是没有把main.ts给编译到src/.umi/main/main.js,手动编译一次复制过去后正常

@BySlin
Copy link
Owner

BySlin commented Feb 25, 2021

插件更新到1.0.17,此问题已修复

@yqnetwork
Copy link

更新的太及时了,太棒的项目了

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

No branches or pull requests

3 participants