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
JSX currently only works in .(j|t)sx files, but not in corresponding <script> blocks of Single File Components. Writing JSX inside a SFC currently throws an error from esbuild (Unexpected "<") during the scan phase when you npm run dev.
in optimizer/scan.ts#L187 and use the correct lang attribute on your script block, e.g. <script lang="jsx">.
This way both the dev server and the build (that one works either way) can be used, however even then HMR isn't working, while it does work for .jsx files.
JSX in Single File Components would be nice, both because even with JSX it is nice to have your scoped styles right next to your other code, and it's also handy to define smaller local (non-exported) components alongside your main one that has a <template>.
The text was updated successfully, but these errors were encountered:
JSX currently only works in
.(j|t)sx
files, but not in corresponding<script>
blocks of Single File Components. Writing JSX inside a SFC currently throws an error from esbuild (Unexpected "<"
) during the scan phase when younpm run dev
.A quick way to fix that is to change this:
to this:
in
optimizer/scan.ts#L187
and use the correct lang attribute on your script block, e.g.<script lang="jsx">
.This way both the dev server and the build (that one works either way) can be used, however even then HMR isn't working, while it does work for
.jsx
files.JSX in Single File Components would be nice, both because even with JSX it is nice to have your scoped styles right next to your other code, and it's also handy to define smaller local (non-exported) components alongside your main one that has a
<template>
.The text was updated successfully, but these errors were encountered: