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

build failed on vite typescript #2895

Open
yasineh opened this issue Jan 8, 2025 · 4 comments
Open

build failed on vite typescript #2895

yasineh opened this issue Jan 8, 2025 · 4 comments

Comments

@yasineh
Copy link

yasineh commented Jan 8, 2025

Describe the bug

Screenshot 2025-01-15 at 13 06 02

preview js fail on opening with the following errors:
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 (/.vscode/extensions/zenclabs.previewjs-1.30.0/dist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1476:15) at //.vscode/extensions/zenclabs.previewjs-1.30.0/dist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:945:25 at runOnEndCallbacks (//.vscode/extensions/zenclabs.previewjs-1.30.0/dist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1316:45) at buildResponseToResult (//.vscode/extensions/zenclabs.previewjs-1.30.0/dist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:943:7) at //.vscode/extensions/zenclabs.previewjs-1.30.0/dist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:970:16 at responseCallbacks.<computed> (//.vscode/extensions/zenclabs.previewjs-1.30.0/dist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:622:9) at handleIncomingPacket (//.vscode/extensions/zenclabs.previewjs-1.30.0/dist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:677:12) at Socket.readFromStdout (//.vscode/extensions/zenclabs.previewjs-1.30.0/dist/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:600:7) at Socket.emit (node:events:520:28) at addChunk (node:internal/streams/readable:559:12)

Reproduction

open preview js on any component on in browser

Preview.js version

1.30.0

Framework

React 18.2.0

System Info

System:
    OS: macOS 15.1.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 189.69 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.7.0 - /opt/homebrew/bin/node
    npm: 10.8.2 - /opt/homebrew/bin/npm
    pnpm: 9.9.0 - /opt/homebrew/bin/pnpm
  IDEs:
    VSCode: 1.96.2 - /usr/local/bin/code
    Vim: 9.0 - /usr/bin/vim
  Browsers:
    Chrome: 131.0.6778.264
    Safari: 18.1.1

Used Package Manager

pnpm

Extension logs (useful for crashes)

No response

Preview logs (useful for rendering errors)

Failed to load resource: the server responded with a status of 404 (Not Found)

Repo link (if available)

No response

Anything else?

No response

@benoitlahoz
Copy link

benoitlahoz commented Jan 16, 2025

Same here width shadcn-vue component and vue 3.5.13 and vite 6.0.2... Too sad...

@fwouts
Copy link
Owner

fwouts commented Jan 16, 2025

Could either of you please provide a sample repo to reproduce the issue?

@Secreto31126
Copy link

Secreto31126 commented Jan 23, 2025

I encountered the exact same issue on an empty SvelteKit proyect:

npx sv create

I think I also updated vite to a newer version, so maybe that could be an issue also. Nope, that was on another project, this is almost untouched.

PS: package.json

"tailwindcss": "^3.4.9",
"typescript": "^5.0.0",
"vite": "^5.4.11"

@MateusPitura
Copy link

The same here with Vite 6.0.9, React 18.3.1 and TypeScript 5.6.2

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

5 participants