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

electron-vite整合ee-core启动时ee-logger模块报错 #141

Closed
hllshiro opened this issue Dec 5, 2024 · 4 comments
Closed

electron-vite整合ee-core启动时ee-logger模块报错 #141

hllshiro opened this issue Dec 5, 2024 · 4 comments

Comments

@hllshiro
Copy link

hllshiro commented Dec 5, 2024

我使用electron-vite搭建项目,并计划集成ee-core使用,目录结构如下:

|-root
|    |- src
|        |- main
|        |- prelaod
|        |- renerder
|

根据官方文档中提到内容

创建controller文件
在项目根目录创建 ./electron/controller/example.js 文件,[controller示例代码](https://github.com/dromara/electron-egg/blob/demo/electron/controller/example.js)

我在项目根目录、main目录下、src目录下都创建了Controller和Service,但启动后没能加载到。

@hllshiro
Copy link
Author

hllshiro commented Dec 5, 2024

通过修改electron.vite.config.ts解决了这个问题,并安装了缺少的better-sqlite3、urllib、ws依赖可以启动,但启动时遇到ee-logger模块报错,请问该如何解决呢?

      let rotateType = opt.logger.rotator;
                                  ^

TypeError: Cannot read properties of undefined (reading 'rotator')
    at Object.create (D:\Project\Javascript\Electron\electron-vite-vue-template\out\main\index.js:28485:35)
    at get coreLogger (D:\Project\Javascript\Electron\electron-vite-vue-template\out\main\index.js:28566:35)
    at process.<anonymous> (D:\Project\Javascript\Electron\electron-vite-vue-template\out\main\index.js:28696:12)
    at process.emit (node:events:531:35)
    at process.emit (node:domain:488:12)
    at process._fatalException (node:internal/process/execution:188:25)

Node.js v20.18.0

@hllshiro hllshiro changed the title 第三方使用Controller和Service无法加载 electron-vite整合ee-core启动时ee-logger模块报错 Dec 5, 2024
@wallace5303
Copy link
Collaborator

可能不太好整合,ee 正在开发 v4,精简臃肿的代码,提供更规范的 api,v5 估计用 ts 重写(生成 cjs esm)到时候估计才能方便的引入

@hllshiro
Copy link
Author

那估计要好久了,还是感谢您的工作。

@wallace5303
Copy link
Collaborator

框架 v4 已经发布,做了非常大的改动,且支持了 ts, 主进程和前端加密,还有热重载等,可以体验一下

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

2 participants