Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unable to "npm run dev" on empty new JetStream project #1211

Closed
emandtf opened this issue Dec 20, 2024 · 1 comment
Closed

[Bug]: Unable to "npm run dev" on empty new JetStream project #1211

emandtf opened this issue Dec 20, 2024 · 1 comment

Comments

@emandtf
Copy link

emandtf commented Dec 20, 2024

Platform

Windows

Operating system version

Windows 10 (22H2)

System architecture

Intel (x86)

Herd Version

1.13.0

PHP Version

8.3.15

Bug description

Unable to run Asset building using Vite.

I tried to manually execute "composer install" and "npm install" but both ended successfully without do any change.

Steps to reproduce

The most simple way:

  1. just download Herd
  2. choose to create a New Site
  3. select Jetstream
  4. choose Livewire + Dark Mode + EmailVerification
  5. set the destination folder

No any other file or setting changed.

Relevant log output

Executing task: npm run dev 

> dev
> vite

X [ERROR] Expected identifier but found "import"

    (define name):1:0:
      1 │ import.meta.dirname
        ╵ ~~~~~~

X [ERROR] Expected identifier but found "import"

    (define name):1:0:
      1 │ import.meta.filename
        ╵ ~~~~~~

X [ERROR] Expected identifier but found "import"

    (define name):1:0:
      1 │ import.meta.url
        ╵ ~~~~~~

failed to load config from C:\PHP\_Herd\test_jetstream\vite.config.js
error when starting dev server:
Error: Build failed with 3 errors:
(define name):1:0: ERROR: Expected identifier but found "import"
(define name):1:0: ERROR: Expected identifier but found "import"
(define name):1:0: ERROR: Expected identifier but found "import"
    at failureErrorWithLog (C:\PHP\_Herd\test_jetstream\node_modules\esbuild\lib\main.js:1476:15)
    at C:\PHP\_Herd\test_jetstream\node_modules\esbuild\lib\main.js:945:25
    at runOnEndCallbacks (C:\PHP\_Herd\test_jetstream\node_modules\esbuild\lib\main.js:1316:45)
    at buildResponseToResult (C:\PHP\_Herd\test_jetstream\node_modules\esbuild\lib\main.js:943:7)
    at C:\PHP\_Herd\test_jetstream\node_modules\esbuild\lib\main.js:970:16
    at responseCallbacks.<computed> (C:\PHP\_Herd\test_jetstream\node_modules\esbuild\lib\main.js:622:9)
    at handleIncomingPacket (C:\PHP\_Herd\test_jetstream\node_modules\esbuild\lib\main.js:677:12)
    at Socket.readFromStdout (C:\PHP\_Herd\test_jetstream\node_modules\esbuild\lib\main.js:600:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)

 *  The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run dev" terminated with exit code: 1.
@tkuijer
Copy link

tkuijer commented Dec 20, 2024

This appears to be a known Vite issue: vitejs/vite#19018
workaround is to force esbuild to use version 0.24.0 instead:
npm i -D [email protected]

@emandtf emandtf closed this as completed Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants