You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
【tip】 After importing the logger.ts file into main.ts of Electron, an error was reported:
[vite]: Rollup failed to resolve import "@/electron/main/modules/logger.ts" from "E:/repository/electron-app/src/electron/main/index.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to build.rollupOptions.external
【environment】
node: v18.16.0
electron: 25.2.0
The text was updated successfully, but these errors were encountered:
At present, I have resolved this error message. The reason for this error message is that vite cannot identify the dependencies or modules of this path. It is necessary to correctly configure the path when importing, such as using aliases or relative paths
// logger.ts
import * as log4js from "log4js";
log4js.configure({
appenders: { cheese: { type: "file", filename: "cheese.log" } },
categories: { default: { appenders: ["cheese"], level: "error" } },
});
const logger = log4js.getLogger();
logger.level = "debug";
logger.debug("Some debug messages");
【tip】 After importing the logger.ts file into main.ts of Electron, an error was reported:
[vite]: Rollup failed to resolve import "@/electron/main/modules/logger.ts" from "E:/repository/electron-app/src/electron/main/index.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
【environment】
node: v18.16.0
electron: 25.2.0
The text was updated successfully, but these errors were encountered: