LoginSignup
1

More than 5 years have passed since last update.

ElectronでTypeError: win.loadUrl is not a function

Posted at

Electronメモ。 Web上に古い情報も多くて紛らわしいですね苦笑

loadUrl()でエラー

メインプロセスのmain.jsにて

  win.loadUrl(`file://${process.cwd()}/index.html`);

という記述をしてたところ

Uncaught Exception:
TypeError: win.loadUrl is not a function ...

というエラーが。

loadURL()で解決

スタックオーバーフローのloadUrl is not working in electronにもあるように

loadUrl() was renamed to loadURL() a while back.

win.loadUrl()の部分をwin.loadURL()に書き換えるとうまくいきました。

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
1