Ideas what could cause static assets from failing to import?
fails with
`Cannot find module './test.png' or its corresponding type declarations.This with
"solid-js": "^1.8.17",
and "@solidjs/start": "^1.0.0",
.
If I create a new project with npm create solid
I can import the test img, trying to pinpoint what could cause my project to fail importing it.
app.config.ts
:
5 Replies
i tried this a while ago, couldn't get it to work, then and just used the
public
folder. But now I figured it's actually nice to be able to import assetsturns out image actually imports correctly, just VSCode shows this error. Curious, I have another window with the
npm create solid
base project open and there is no error in VSCode thereSeems like a tsconfig issue. Are the configs the same in both projects?
I thought i checked that it's identical to the default tsconfig.json
Maybe add vite types
So add vite as a dev dep and add
vite/client
to the types
field of the tsconfig
(This is because vite includes types for handling the imports of *.png
and i think vinxi doesn't re-export vite types correctly sometimes)