[plugin:vite:esbuild] Transform failed with 3 errors:
C:/projects/pos/src/main/frontend/views/@layout.tsx:1:856: ERROR: The symbol “inWebWorker” has already been declared
C:/projects/pos/src/main/frontend/views/@layout.tsx:1:952: ERROR: The symbol “prevRefreshReg” has already been declared
C:/projects/pos/src/main/frontend/views/@layout.tsx:1:971: ERROR: The symbol “prevRefreshSig” has already been declared
here is additional trace:
at failureErrorWithLog (C:\projects\pos\node_modules\esbuild\lib\main.js:1472:15)
at C:\projects\pos\node_modules\esbuild\lib\main.js:755:50
at responseCallbacks.<computed> (C:\projects\pos\node_modules\esbuild\lib\main.js:622:9)
at handleIncomingPacket (C:\projects\pos\node_modules\esbuild\lib\main.js:677:12)
at Socket.readFromStdout (C:\projects\pos\node_modules\esbuild\lib\main.js:600:7)
at Socket.emit (node:events:518:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23
Here’s what my vite.config.ts looks like (in a project with a working shadcn config)
import path from "node:path";
import type { UserConfigFn } from "vite";
import { overrideVaadinConfig } from "./vite.generated";
const customConfig: UserConfigFn = (env) => ({
resolve: {
alias: {
"@": path.resolve(__dirname, "./src/main/frontend"),
},
},
});
export default overrideVaadinConfig(customConfig);
I used the “manual” setup guide as far as i can remember - you need to adapt some steps to vaadin/hilla e.g. baseUrl should remain "src/main/frontend") in the tsconfig.json: Manual Installation - shadcn/ui