nksaraf / vinxi

The Full Stack JavaScript SDK
https://vinxi.vercel.app
MIT License
1.91k stars 77 forks source link

solid-start project can't access `import.meta.env` #269

Closed greg-hammond closed 2 months ago

greg-hammond commented 6 months ago

Attempting to access import.meta.env gives a type error: Property 'env' does not exist on type 'ImportMeta'

Per Nikhil this is an issue separate from what was fixed in #265. There is an additional fix needed related to type exports within vinxi.

Steps to repro: pnpm create solid pnpm install

attempt to access import.meta.env within app.tsx

edivados commented 6 months ago

@nksaraf Should vinxi/types/client be used instead of vinxi/client? The latter is empty and the reason it works with npm in solid-start seems to be because Ryan added vite/client to tsconfig.

Brendonovich commented 4 months ago

Turns out the Vinxi docs and a lot of the examples use vinxi/types/client instead of vinxi/client. SS should probably be updated so that manually adding vite/client isn't necessary.

image
edivados commented 2 months ago

Yeah. SolidStart examples have been updated some time ago to use vinxi/types/client so this should not be a problem anymore.

greg-hammond commented 2 months ago

I'm fine to close this - it seems that usage of vinxi/types/client has percolated through the ecosystem, and this is no longer an issue.