When I use the JavaScript API to start vite server from a Node script, I got the following errors
[vite] Internal server error: Transform failed with 3 errors:
App.tsx:1:810: ERROR: The symbol "inWebWorker" has already been declared
App.tsx:1:906: ERROR: The symbol "prevRefreshReg" has already been declared
App.tsx:1:925: ERROR: The symbol "prevRefreshSig" has already been declared
Plugin: vite:esbuild
Looks like something related to react-refresh?
The same errors did not occur when I started the server with the CLI
This is how I used the JavaScript API
import viteConfig from './vite.config.js';
createServer(viteConfig).then(viteServer => {
viteServer.listen().then(() => {
viteServer.printUrls();
viteServer.bindCLIShortcuts({ print: true });
});
});