electron-vite / vite-plugin-electron-renderer

Ployfill Node.js API for Renderer process

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: path argument is undefined on Windows

mtdvlpr opened this issue · comments

I'm getting the following error while trying to startup my electron-nuxt project on Windows. On Linux everything works fine.

When I open vite-plugin-electron-renderer/index.js:205 it's about the following lines:

node_modules_path = node_modules(config.root ? path.resolve(config.root) : process.cwd())[0];
cache = new Cache(path.join(node_modules_path, CACHE_DIR));

This is the full error I get in my terminal:

 ERROR  Cannot start nuxt:  The "path" argument must be of type string. Received undefined  

  at new NodeError (node:internal/errors:399:5)
  at validateString (node:internal/validators:163:11)
  at Object.join (node:path:429:7)
  at config (node_modules\vite-plugin-electron-renderer\index.js:205:30)
  at runConfigHook (node_modules/@nuxt/vite-builder/node_modules/vite/dist/node/chunks/dep-ca21228b.js:62375:31)
  at async resolveConfig (node_modules/@nuxt/vite-builder/node_modules/vite/dist/node/chunks/dep-ca21228b.js:61876:14)
  at async Module.createServer (node_modules/@nuxt/vite-builder/node_modules/vite/dist/node/chunks/dep-ca21228b.js:61153:20)
  at async buildClient (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.4c561c43.mjs:509:24)
  at async bundle (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.4c561c43.mjs:1133:3)
  at async build (node_modules/nuxt/dist/index.mjs:2927:5)

Maybe you can explicitly set the root value to resolve it.

@caoxiemeihao, the application starts up successfully! I set vite: {root: process.cwd()} in nuxt config. I do get another error, but it doesn't seem blocking and might be unrelated:

[uncaughtException] 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(). The promise rejected with the reason "Search string not found: "ts.executeCommandLine(ts.sys, ts.noop, ts.sys.args);"".

[uncaughtException] 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(). The promise rejected with the reason "Search string not found: "ts.executeCommandLine(ts.sys, ts.noop, ts.sys.args);"".

Yeah, this error looks not appear to be vite-plugin-electron-renderer 👀