Open DanqingLuan opened 4 months ago
Steps:
1.Create a new SolidStart project. 2.Create a new file named svgtest.tsx. 3.Paste the following code into the svgtest.tsx file:
export default function SVGTEST() { let isUpperCase = false; const a = "ok"; return (<text>{isUpperCase ? a : a.toLocaleUpperCase()} </text>) }
4.Insert into the index.tsx file.
<SVGTEST></SVGTEST>
5.Run index.tsx and an error occurs. 6.Change the code in svgtest.tsx to the following: 7.The error disappears.
export default function SVGTEST() { let isUpperCase = false; const a = "ok"; return (<text>{isUpperCase ? a : a.toLocaleUpperCase()}</text>) }
This looks like a compiler error and has nothing to do with SolidStart. I can reproduce it in the playground: https://playground.solidjs.com/anonymous/6e22d979-a8f8-4548-b74f-1ebc68d67a4b
I will move this where it belongs
Duplicates
Latest version
Current behavior 😯
export default function SVGTEST() { let isUpperCase = false; const a = "ok"; return (<text>{isUpperCase ? a : a.toLocaleUpperCase()} </text>) }
An error occurs when there is a space between the closing curly brace
}
and the closing tag</text>
at the end of the code, as in:} </text>
However, the error disappears if the space is removed, as in:
}</text>
22:36:11 [vite] Internal server error: C:\Users\admin\Desktop\solid-project\src\components\typing\SVGTEST.tsx: Property value expected type of boolean but got undefined Plugin: solid File: C:/Users/admin/Desktop/solid-project/src/components/typing/SVGTEST.tsx at Object.validate (C:\Users\admin\Desktop\solid-project\node_modules\@babel\types\lib\definitions\utils.js:127:13) at validateField (C:\Users\admin\Desktop\solid-project\node_modules\@babel\types\lib\validators\validate.js:21:9) at validate (C:\Users\admin\Desktop\solid-project\node_modules\@babel\types\lib\validators\validate.js:15:3) at validateNode (C:\Users\admin\Desktop\solid-project\node_modules\@babel\types\lib\builders\validateNode.js:12:27) at Object.booleanLiteral (C:\Users\admin\Desktop\solid-project\node_modules\@babel\types\lib\builders\generated\index.js:450:36) at C:\Users\admin\Desktop\solid-project\node_modules\babel-plugin-jsx-dom-expressions\index.js:1875:31 at Array.map ()
at appendTemplates$1 (C:\Users\admin\Desktop\solid-project\node_modules\babel-plugin-jsx-dom-expressions\index.js:1863:33)
at PluginPass.postprocess (C:\Users\admin\Desktop\solid-project\node_modules\babel-plugin-jsx-dom-expressions\index.js:3653:32)
at newFn (C:\Users\admin\Desktop\solid-project\node_modules\@babel\traverse\lib\visitors.js:160:14)
at NodePath._call (C:\Users\admin\Desktop\solid-project\node_modules\@babel\traverse\lib\path\context.js:46:20)
at NodePath.call (C:\Users\admin\Desktop\solid-project\node_modules\@babel\traverse\lib\path\context.js:36:17)
at NodePath.visit (C:\Users\admin\Desktop\solid-project\node_modules\@babel\traverse\lib\path\context.js:90:8)
at TraversalContext.visitQueue (C:\Users\admin\Desktop\solid-project\node_modules\@babel\traverse\lib\context.js:89:16)
at TraversalContext.visitSingle (C:\Users\admin\Desktop\solid-project\node_modules\@babel\traverse\lib\context.js:65:19)
at TraversalContext.visit (C:\Users\admin\Desktop\solid-project\node_modules\@babel\traverse\lib\context.js:112:19)
at traverseNode (C:\Users\admin\Desktop\solid-project\node_modules\@babel\traverse\lib\traverse-node.js:22:17)
at traverse (C:\Users\admin\Desktop\solid-project\node_modules\@babel\traverse\lib\index.js:52:34)
at transformFile (C:\Users\admin\Desktop\solid-project\node_modules\@babel\core\lib\transformation\index.js:82:31)
at transformFile.next ()
at run (C:\Users\admin\Desktop\solid-project\node_modules\@babel\core\lib\transformation\index.js:24:12)
at run.next ()
at transform (C:\Users\admin\Desktop\solid-project\node_modules\@babel\core\lib\transform.js:22:33)
at transform.next ()
at step (C:\Users\admin\Desktop\solid-project\node_modules\gensync\index.js:261:32)
at C:\Users\admin\Desktop\solid-project\node_modules\gensync\index.js:273:13
at async.call.result.err.err (C:\Users\admin\Desktop\solid-project\node_modules\gensync\index.js:223:11)
at C:\Users\admin\Desktop\solid-project\node_modules\gensync\index.js:189:28
at C:\Users\admin\Desktop\solid-project\node_modules\@babel\core\lib\gensync-utils\async.js:67:7
at C:\Users\admin\Desktop\solid-project\node_modules\gensync\index.js:113:33
at step (C:\Users\admin\Desktop\solid-project\node_modules\gensync\index.js:287:14)
at C:\Users\admin\Desktop\solid-project\node_modules\gensync\index.js:273:13
at async.call.result.err.err (C:\Users\admin\Desktop\solid-project\node_modules\gensync\index.js:223:11) (x2)
Expected behavior 🤔
No response
Steps to reproduce 🕹
Steps:
1.Create a new SolidStart project. 2.Create a new file named svgtest.tsx. 3.Paste the following code into the svgtest.tsx file: into the index.tsx file.
5.Run index.tsx and an error occurs.
6.Change the code in svgtest.tsx to the following:
7.
export default function SVGTEST() { let isUpperCase = false; const a = "ok"; return (<text>{isUpperCase ? a : a.toLocaleUpperCase()} </text>) }
4.Insertexport default function SVGTEST() { let isUpperCase = false; const a = "ok"; return (<text>{isUpperCase ? a : a.toLocaleUpperCase()}</text>) }
The error disappears.Context 🔦
No response
Your environment 🌎