I have a react app that I am trying to convert to use typescript
but I'm getting the following error: InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/index.c6592bb6.ts') is not a valid name.
What does this error even mean? It looks like it doesn't like the typescript extension
Any ideas how to fix?
In my case, I was building my web app and I had created a javaScript file in the IDE IntelliJ. But in the folder, the file name was missing the suffix ".js". So when I used 'npm run dev' command in the terminal, it failed to find the file I had created.
If it is the same for you, then just go to the folder and add the suffix ".js" in the file name.
I think it's a bug in IntelliJ, Hopefully they may fix it later on.
In my case, it was just importing asset like this
import { ReactComponent as PaintIcon } from "./assets/paint.svg";
instead of
import PaintIcon from "./assets/paint.svg";
Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With