-
Notifications
You must be signed in to change notification settings - Fork 0
React TypeScript Error: You may need an additional loader to handle the result of these loaders
Daisho Komiyama edited this page Oct 10, 2021
·
3 revisions
I was facing this error when I tried to convert React app using TypeScript.
ERROR in ./src/client/components/header/Header.tsx 45:12
[1] Module parse failed: Unexpected token (45:12)
[1] File was processed with these loaders:
[1] * ./node_modules/ts-loader/index.js
[1] You may need an additional loader to handle the result of these loaders.
Upon further investigation, it turned out that in tsconfig.json
, I needed to change the value of jsx
from preserve
to react
.
From this
"jsx": "preserve"
to this
"jsx": "react"
Then the error disappeared, and I started seeing the rendered page.