oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.15k stars 2.68k forks source link

Vite's createServer() fails when package.json's "type": "module" #13203

Open botikho opened 1 month ago

botikho commented 1 month ago

What version of Bun is running?

1.1.22

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

Bun fails to start when trying to use vite's createServer() with non-falsy configFile. It starts to reload repeatedly with no even a message or error.

By default createServer() is trying to load root vite.config.ts. But Bun fails to load this config for some reason. It creates and deletes root file "vite.config.ts.timestamp-1723215060966-dab43e401f819.mjs" endlessly and nothing happens.

Have to note that it only happens when package.json has "type": "module".

What is the expected behavior?

Expecting Bun to start properly.

What do you see instead?

Empty console

Additional information

No response

huseeiin commented 1 month ago

a possible workaround is to be able to ignore some files with --watch but that is blocked by #3398