DAMACANSU
DAMACANSU3y ago

✅ – Cansu – 10-12 Oct 30

Cannot use JSX unless the '--jsx' flag is provided.
Solution:
yes
Jump to solution
7 Replies
DAMACANSU
DAMACANSUOP3y ago
Ahem.
ERROR in src/app.tsx:44:5
TS17004: Cannot use JSX unless the '--jsx' flag is provided.
42 |
43 | return (
> 44 | <div>
| ^^^^^
45 | <button id="button" onClick={send}> VUR BANA </button>
46 | {/*put server message here*/}
47 | <div>{outerHTML}</div>

ERROR in src/app.tsx:45:5
TS17004: Cannot use JSX unless the '--jsx' flag is provided.
43 | return (
44 | <div>
> 45 | <button id="button" onClick={send}> VUR BANA </button>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 | {/*put server message here*/}
47 | <div>{outerHTML}</div>
48 | </div>

ERROR in src/app.tsx:47:5
TS17004: Cannot use JSX unless the '--jsx' flag is provided.
45 | <button id="button" onClick={send}> VUR BANA </button>
46 | {/*put server message here*/}
> 47 | <div>{outerHTML}</div>
| ^^^^^
48 | </div>
49 | )
50 |
ERROR in src/app.tsx:44:5
TS17004: Cannot use JSX unless the '--jsx' flag is provided.
42 |
43 | return (
> 44 | <div>
| ^^^^^
45 | <button id="button" onClick={send}> VUR BANA </button>
46 | {/*put server message here*/}
47 | <div>{outerHTML}</div>

ERROR in src/app.tsx:45:5
TS17004: Cannot use JSX unless the '--jsx' flag is provided.
43 | return (
44 | <div>
> 45 | <button id="button" onClick={send}> VUR BANA </button>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 | {/*put server message here*/}
47 | <div>{outerHTML}</div>
48 | </div>

ERROR in src/app.tsx:47:5
TS17004: Cannot use JSX unless the '--jsx' flag is provided.
45 | <button id="button" onClick={send}> VUR BANA </button>
46 | {/*put server message here*/}
> 47 | <div>{outerHTML}</div>
| ^^^^^
48 | </div>
49 | )
50 |
Compiled with >
tsc --jsx react
https://pastebinp.com/7ldn4NZEaiBd7ch6gmtQ#ThdmsQr9e1qlQgoZdgJ5EFLsbpnIV2cFWdB5GUzUgTU= this is the tsconfig.json and this is how i run npm start
npm start --jsx
lebouwski
lebouwski3y ago
the jsx line is commented out in tsconfig, remove the comment and set it to react
DAMACANSU
DAMACANSUOP3y ago
// "jsx": "preserve", /* Specify what JSX code is generated. */
?
Solution
lebouwski
lebouwski3y ago
yes
DAMACANSU
DAMACANSUOP3y ago
thank you it worked thank you thank you
lebouwski
lebouwski3y ago
meowthumbsup
reactibot
reactibot3y ago
This question has an answer! Thank you for helping 😄 If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/1036221094157365278 This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/1036221094157365278

Did you find this page helpful?