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
Google Chrome Version 112.0.5615.137 (Official Build) (arm64)
Running in Sail?
Sail
Description
After a fresh laravel installation I get this error.
__dirname is not defined
at file:///var/www/html/node_modules/laravel-vite-plugin/dist/index.mjs:128:39
at call (file:///var/www/html/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:49019:7)
at next (file:///var/www/html/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:48963:5)
at file:///var/www/html/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:61287:17
at viteHtmlFallbackMiddleware (file:///var/www/html/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:61367:16)
at call (file:///var/www/html/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:49019:7)
at next (file:///var/www/html/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:48963:5)
at viteServeStaticMiddleware (file:///var/www/html/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:46030:20)
at call (file:///var/www/html/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:49019:7)
at next (file:///var/www/html/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:48963:5
Click outside or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.js.
Vite Plugin Version
0.7.5
Laravel Version
10.8
Node Version
18.16.0
NPM Version
9.6.6
Operating System
macOS
OS Version
13.3.1
Web browser and version
Google Chrome Version 112.0.5615.137 (Official Build) (arm64)
Running in Sail?
Sail
Description
After a fresh laravel installation I get this error.
index.mjs:128 is:
It seems to me __dirname can not be used because it is an ES module.
Adding these lines in before line 128 fixes the problem for me:
Steps To Reproduce
http://localhost:5173/
The text was updated successfully, but these errors were encountered: