-
Notifications
You must be signed in to change notification settings - Fork 44
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
Acorn: SyntaxError: Identifier 'RefreshRuntime' has already been declared #1361
Labels
Comments
Hey @tony19, sorry about the radio silence. Fix coming soon :) |
Any estimate when will the new version be released to the marketplace? |
@TheYarin aiming for early next week. |
🙏 |
v1.17.4 was just pushed to VS Code Marketplace, should be live within an hour or two. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Preview.js cannot render basic React component in newly scaffolded Vite React TypeScript + SWC project. It works fine for the normal Vite React TypeScript template (without SWC).
Logs
Unable to render HelloWorld While Preview.js can work out of the box for simple components, you may need a custom configuration to render components that depend on:a specific state or context (see Wrapping components)
modules imported via aliases
static assets or SVGR
Please see the logs below:
[5:49:58 PM] Unable to parse /Users/atrinh5/src/tmp/vite-tmp/src/components/HelloWorld.tsx with Acorn: SyntaxError: Identifier 'RefreshRuntime' has already been declared (10:7)
[5:49:58 PM] TypeError: Failed to fetch dynamically imported module: http://localhost:3141/preview/src/components/HelloWorld.tsx
Reproduction
npm init vite@latest
. Pick React and TypeScript + SWC.src/components/HelloWorld.tsx
with sample code:Open HelloWorld in Preview.js
(shown above component name inHelloWorld.tsx
).Preview.js version
v1.17.3
Framework
React 18.2.0
System Info
Used Package Manager
npm
Extension logs (useful for crashes)
Preview logs (useful for rendering errors)
logs.ts:9 [vite] Internal Server Error Unable to parse /Users/atrinh5/src/tmp/vite-tmp/src/components/HelloWorld.tsx with Acorn: SyntaxError: Identifier 'RefreshRuntime' has already been declared (10:7) at findTopLevelEntityNames (/Users/atrinh5/.vscode/extensions/zenclabs.previewjs-1.17.3/dist/node_modules/.pnpm/@previewjs+core@15.1.2_@types+node@18.11.18/node_modules/@previewjs/core/dist/index.cjs:370:11) at TransformContext.transform (/Users/atrinh5/.vscode/extensions/zenclabs.previewjs-1.17.3/dist/node_modules/.pnpm/@previewjs+core@15.1.2_@types+node@18.11.18/node_modules/@previewjs/core/dist/index.cjs:354:35) at Object.transform (file:///Users/atrinh5/.vscode/extensions/zenclabs.previewjs-1.17.3/dist/node_modules/.pnpm/vite@4.0.4_@types+node@18.11.18/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:41506:44) at async loadAndTransform (file:///Users/atrinh5/.vscode/extensions/zenclabs.previewjs-1.17.3/dist/node_modules/.pnpm/vite@4.0.4_@types+node@18.11.18/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:39313:29) (anonymous) @ logs.ts:9 18:00:21.586 logs.ts:9 TypeError: Failed to fetch dynamically imported module: http://localhost:3141/preview/src/components/HelloWorld.tsx
Repo link (if available)
https://github.com/tony19-sandbox/vite-ts-react-swc
Anything else?
No response
The text was updated successfully, but these errors were encountered: