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
438 | function trimWhitespace(text) {
439 | text = text.replace(/\r/g, "");
^
TypeError: /home/axel/hytts/src/jsx/jsx.test.tsx: text.replace is not a function. (In 'text.replace(/\r/g, "")', 'text.replace' is undefined)
code: "BABEL_TRANSFORM_ERROR",
at trimWhitespace (/home/axel/hytts/node_modules/babel-plugin-jsx-dom-expressions/index.js:439:15)
at <anonymous> (/home/axel/hytts/node_modules/babel-plugin-jsx-dom-expressions/index.js:2598:16)
at forEach (1:11)
at transformAttributes$1 (/home/axel/hytts/node_modules/babel-plugin-jsx-dom-expressions/index.js:2484:14)
at transformElement$2 (/home/axel/hytts/node_modules/babel-plugin-jsx-dom-expressions/index.js:2287:3)
at transformJSX (/home/axel/hytts/node_modules/babel-plugin-jsx-dom-expressions/index.js:3570:18)
...
Obviously, the code is somewhat questionable and doesn't really make sense. Nevertheless, such a transpiler error is unexpected.
The code above should either compile to <div class="true" /> or a sensible error message should be raised.
The text was updated successfully, but these errors were encountered:
axel-habermaier
changed the title
Transpiler crashes when Boolean value is assigned to class prop
Transpiler error when Boolean value is assigned to class prop
Jan 10, 2025
axel-habermaier
changed the title
Transpiler error when Boolean value is assigned to class prop
Transpiler error when Boolean value is assigned to class prop during SSR
Jan 10, 2025
I cannot reproduce the error, so I will leave it like that for now till other PRs get merged as theres some handling of true and false. BTW, what should be doing is adding an empty attribute, as <div class/> instead of <div class="true"/>, if you want true to be the value of the attribute you should be using a string.
Consider the following code:
This causes a transpiler error in SSR-mode:
Obviously, the code is somewhat questionable and doesn't really make sense. Nevertheless, such a transpiler error is unexpected.
The code above should either compile to
<div class="true" />
or a sensible error message should be raised.The text was updated successfully, but these errors were encountered: