question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
JoviDeCroockcommented, Jun 14, 2022

As far as I can tell this is an issue with cjs-module-lexer and export * is missinterpreted by it, it does not see them as reexports. This was seen in urql as well https://github.com/FormidableLabs/urql/pull/2485

0reactions
JoviDeCroockcommented, Jun 27, 2022

This might solve your issue as well @brillout https://github.com/preactjs/preset-vite/pull/50

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found