0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windowsでelectron-viteを使った際に発生した3221226505エラーについての備忘録

Posted at

TL;DR

ディレクトリ名に2バイト文字を含めてはいけない

環境

名前 バージョン
OS Windows 11 Home 23H2
node v24.3.0
yarn 1.22.22
Electron ^35.1.5
vite ^6.2.6
electron-vite ^4.0.0

補足:作業ディレクトリはドキュメント内にあります

エラー内容

yarn devした際に1回目は正常にアプリケーションが起動するが

vite v6.3.5 building SSR bundle for development...
✓ 2 modules transformed.
out/main/index.js  1.48 kB
✓ built in 323ms

build the electron main process successfully

-----

vite v6.3.5 building SSR bundle for development...
✓ 1 modules transformed.
out/preload/index.js  0.42 kB
✓ built in 28ms

build the electron preload files successfully

-----

dev server running for the electron renderer process at:

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose

start electron app...

2回目以降は謎のエラーが発生し止まってしまう

yarn dev
yarn run v1.22.22
$ electron-vite dev --logLevel info
vite v6.3.5 building SSR bundle for development...
✓ 2 modules transformed.
error Command failed with exit code 3221226505.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

原因

どうやらelectron-viteの中で呼び出しているviteの中で呼び出しているfs.rmSyncは2バイト文字がディレクトリに含まれているとエラーが起きるみたいです。

対処法

作業ディレクトリを2バイト文字がない場所(例:Cドライブ直下)などに移動させました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?