> spark-template@0.0.0 dev
> vite
7:54:09 PM [vite] (client) Re-optimizing dependencies because lockfile has changed
Port 5000 is in use, trying another one...
VITE v7.3.1 ready in 381 ms
➜ Local: http://localhost:5001/
➜ Network: http://10.0.0.185:5001/
➜ press h + enter to show help
7:54:16 PM [vite] (client) warning:
/workspaces/spark-template/src/lib/component-registry.ts
21 | for (const path of pathVariants){
22 | try {
23 | const module = await import(path);
| ^^^^
24 | const exportName = componentConfig.export || 'default';
25 | if (module[exportName]) {
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
Plugin: vite:import-analysis
File: /workspaces/spark-template/src/lib/component-registry.ts
7:54:16 PM [vite] (client) warning:
/workspaces/spark-template/src/lib/unified-storage.ts
201 | const moduleName = 'sql.js';
202 | try {
203 | return await import(moduleName);
| ^^^^^^^^^^
204 | } catch {
205 | throw new Error(`${moduleName} not installed. Run: npm install ${moduleName}`);
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
Plugin: vite:import-analysis
File: /workspaces/spark-template/src/lib/unified-storage.ts
7:54:23 PM [vite] (client) ✨ new dependencies optimized: framer-motion
7:54:23 PM [vite] (client) ✨ optimized dependencies changed. reloading
7:54:23 PM [vite] (client) warning:
/workspaces/spark-template/src/lib/component-registry.ts
21 | for (const path of pathVariants){
22 | try {
23 | const module = await import(path);
| ^^^^
24 | const exportName = componentConfig.export || 'default';
25 | if (module[exportName]) {
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
Plugin: vite:import-analysis
File: /workspaces/spark-template/src/lib/component-registry.ts
7:54:24 PM [vite] (client) warning:
/workspaces/spark-template/src/lib/unified-storage.ts
201 | const moduleName = 'sql.js';
202 | try {
203 | return await import(moduleName);
| ^^^^^^^^^^
204 | } catch {
205 | throw new Error(`${moduleName} not installed. Run: npm install ${moduleName}`);
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
Plugin: vite:import-analysis
File: /workspaces/spark-template/src/lib/unified-storage.ts
> spark-template@0.0.0 prebuild
> mkdir -p /tmp/dist || true
> spark-template@0.0.0 build
> tsc -b --noCheck && vite build
vite v7.3.1 building client environment for production...
<script src="/runtime-config.js"> in "/index.html" can't be bundled without type="module" attribute
✓ 37 modules transformed.
✗ Build failed in 1.07s
error during build:
[vite]: Rollup failed to resolve import "@github/spark/hooks" from "/workspaces/low-code-react-app-b/src/hooks/use-project-state.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
at viteLog (file:///workspaces/low-code-react-app-b/node_modules/vite/dist/node/chunks/config.js:33635:57)
at file:///workspaces/low-code-react-app-b/node_modules/vite/dist/node/chunks/config.js:33669:73
at onwarn (file:///workspaces/low-code-react-app-b/node_modules/@vitejs/plugin-react-swc/index.js:76:7)
at file:///workspaces/low-code-react-app-b/node_modules/vite/dist/node/chunks/config.js:33669:28
at onRollupLog (file:///workspaces/low-code-react-app-b/node_modules/vite/dist/node/chunks/config.js:33664:63)
at onLog (file:///workspaces/low-code-react-app-b/node_modules/vite/dist/node/chunks/config.js:33467:4)
at file:///workspaces/low-code-react-app-b/node_modules/rollup/dist/es/shared/node-entry.js:20961:32
at Object.logger [as onLog] (file:///workspaces/low-code-react-app-b/node_modules/rollup/dist/es/shared/node-entry.js:22848:9)
at ModuleLoader.handleInvalidResolvedId (file:///workspaces/low-code-react-app-b/node_modules/rollup/dist/es/shared/node-entry.js:21592:26)
at file:///workspaces/low-code-react-app-b/node_modules/rollup/dist/es/shared/node-entry.js:21550:26
@johndoe6345789 ➜ /workspaces/low-code-react-app-b (main) $
VITE_BASE_URL / VITE_PUBLIC_PATH (or equivalent)
Many templates do this in vite.config.ts:
base: import.meta.env.VITE_BASE_URL,
or:
base: process.env.VITE_BASE_URL,
If that variable:
is undefined
defaults to /
or was set to http://localhost:5000
then Vite bakes the wrong paths into the JS bundles.
nginx then serves files that point to nowhere → flaky load.