Closed shybyte closed 4 years ago
@shybyte
In the src
directory create a file assets.d.ts
or whatever name you would like, and add in:
declare module "*.svg" {
const content: any;
export default content;
}
Reference: https://webpack.js.org/guides/typescript/#importing-other-assets
Thanks @s0kil . I can't believe I missed that. I like remember doing that. But maybe it was in a different project. But I don't remember having any build errors,... but that's probably because of babel. Ok yeah I probably should have that in there. Although weirdly it's not there in the source (this is lifted from Create React).. https://github.com/facebook/create-react-app/tree/master/packages/cra-template-typescript/template. Very strange.
@shybyte I will look into this (and this reminds me, update the Solid logo). Sorry for any inconvenience.
I found that react was packing a global typedef for this stuff but I was having some issues getting this working without messing with the tsconfig (even then I couldn't just add to typeRoots). So while this appears fixed it isn't just a matter of updating the scripts project. It's probably easiest to just redo it fresh. Alternatively do as @s0kil suggested. New installations should work now at least. I've done a fresh install myself to check.
Thank you so much for bringing this to my attention. And let me know if you have any other issues.
@ryansolid Wow, this was the fastest github-issue-creation-to-bugfix experience I had ever. Thank you!
When I run:
I get the TypeScript compile error:
"npm start" works fine.