-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with Vite + SolidJS: jsxImportSource and import.meta.env #811
Comments
Quokka supports compiling TypeScript files in either TypeScript or Babel (not Vite). Quokka using TypeScript (the default), doesn't currently support any options for Having said that, you can configure Quokka to support your scenario by configuring Quokka to use Babel instead of TypeScript and with some babel configuration. It also looks like you can configure Babel to emulate With Babel, you should be able to configure everything to work for your scenario. |
Thanks. The main reason I was happy that you guys added vitest support to Wallaby was that I could drop the Babel deps and not need to configure everything twice. This was quite a pain due to little differences in the config. e.g. at one point the So I happily got rid of Babel and only just found out I lost Quokka in the process : ( Will you consider adding vite support? The jsx support is not such a big deal - I normally use Quokka to mess about with functions in other layers. I just have to be more careful to keep my jsx to where it needs to be. I can probably also work around the import.meta problem by detecting if the code is running in vite, and avoiding import.meta if not. |
Adding vite support to Quokka would require us to build something similar to I understand wanting to have a single configuration and how subtle differences can cause problems but I do think you should be able to get things working nicely with babel. If you don't want to install babel and babel dependencies in your project, you can install them in your |
My project uses Vite and SolidJS, and I'm having trouble running quokka.
tsx files
First up, my tsconfig has
"jsxImportSource": "solid-js"
which gives the error:Option 'JSXImportSource' cannot be specified when option 'jsx' is 'react'
In fact the jsx option in my tsconfig is set to 'preserve'
If I use a Quokka config to set jsx compiler option to 'preserve' I then get
unexpected token <
from tsx files.import.meta
If I avoid importing any tsx, I hit the second problem which is that quokka trips up on
import.meta.env
, which is used by Vite to provide environment vars to the app.I guess both of these imply that Vite transformations are not running. Is it supported? Any workaround for import.meta?
Thanks
The text was updated successfully, but these errors were encountered: