Doesn't work with Vite 3
See original GitHub issue- Check if updating to the latest Preact version resolves the issue
Describe the bug
Preact doesn’t work with Vite 3 (3.0.0-alpha.9
).
To Reproduce
See https://github.com/brillout/preact-vite3.
CodeSandbox: https://codesandbox.io/s/github/brillout/preact-vite3
Expected behavior
Preact seems to inject a require
statement which it shouldn’t because Vite 3 is now ESM by default.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
[Vite 3] HMR doesn't work on first dev · Issue #8719 - GitHub
Describe the bug HMR doesn't work the first time the dev server is started.
Read more >Vite 3.0 is out!
Vite 3.0 is out! #. In February last year, Evan You released Vite 2. Since then, its adoption has grown non-stop, reaching more...
Read more >Vue 3 + vite works on development but not in production
When i run on development mode, it works fine. Then i built the website using yarn build and run it with yarn preview,...
Read more >Installing and Setting Up Vue Router with Vite (Vite Only) - A...
Unlike Vue CLI, Vite does not provide an option to setup Vue Router for you. That's ok though, because it allows us a...
Read more >Vite 3.0 vs. Create React App: Comparison and migration guide
Vite doesn't need to bundle the entire app or transpile the modules and code before starting a dev server; transpiling is done on-demand,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As far as I can tell this is an issue with
cjs-module-lexer
andexport *
is missinterpreted by it, it does not see them asreexports
. This was seen in urql as well https://github.com/FormidableLabs/urql/pull/2485This might solve your issue as well @brillout https://github.com/preactjs/preset-vite/pull/50