-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
JSX Render Functions in Nuxt 2 with Nuxt Bridge are failing #17
Comments
+1 |
I just wanted to check in on the status of this. I am facing issues with syntax errors when attempting to run my Nuxt 2 project with Bridge. Is there a way to configure my project to use Vite instead of webpack? Would that resolve my issue? |
The Code Sandbox I attached here is still failing to build, despite some work in the right direction. What more needs to be done to fix this? Happy to submit a PR if someone can point me in the right direction? |
+1,if use defineNuxtConfig babel presets will be unuseful |
+1 |
+1 |
Yes, I can confirm the issue persists (reproduction - and working without Bridge), though a workaround is to enable vite mode @tylerforesthauser: import { defineNuxtConfig } from '@nuxt/bridge'
export default defineNuxtConfig({
bridge: {
vite: true,
},
}) |
Does anyone have a workaround for this? Apart from Vite which unfortunately is a no-go at the moment |
+1 |
@danielroe Any updates for webpack? |
The workaround to enable vite does not work for me, though it does give me nicer-looking error messages:
The error appears to go away when I edit the |
If you use jsx/tsx with nuxt/bridge, you need to add the export default defineNuxtConfig({
birdge: {
typescript: { isTSX: true }
}
}) |
Environment
Nuxt CLI v3.0.0-27234503.d5127e9
RootDir: /sandbox
Nuxt project info:
Linux
v14.17.6
2.16.0-27226092.034b9901
Yarn
Webpack
buildModules
-
@nuxt/[email protected]
Describe the bug and expected behavior
Attempting to use JSX inside a render function is now failing with
Syntax Error: Unexpected token, expected ","
Steps to reproduce
View the compilation error in context here:
https://codesandbox.io/s/suspicious-euclid-g904s?
I expect to see "Hello Nuxt!" wrapped in a div with a class of "a-container-class".
Additional context
This code was working without the upgrade nuxt bridge.
The text was updated successfully, but these errors were encountered: