Wrapping SolidStart: JSX is an unknown file extension

https://stackblitz.com/edit/sb1-k8bui6zy I am trying to create my own CLI to wrap around SolidStart CLI (Vinxi) to make a sort of meta-SolidStart framework. I kept running into problems with my project so I successfully re-created the errors in the stackblitz link above. I left some Readme files inside the packages to clarify what I'm trying to do. I want to use my custom CLI to control Vinxi, so I setup a CLI tool to run this code as a proof of concept:
const app = defineConfig({}); // Will later populate the config
await app.dev();
const app = defineConfig({}); // Will later populate the config
await app.dev();
I'm a bit unfamiliar working on complex monorepo setups, and I believe that's what problem I'm really facing. The error I get is:
Failed to load url `example/src/entry-server.tsx` in virtual:$vinxi/handler/ssr. Does the file exist?
Failed to load url `example/src/entry-server.tsx` in virtual:$vinxi/handler/ssr. Does the file exist?
I am unsure on how to proceed in fixing this. Any help is appreciated!
1 Reply
RATIU5
RATIU5OP3w ago
Update: I fixed several errors by filling out this app config for SolidStart:
const app = defineConfig({
appRoot: path.resolve(__dirname, '../src'),
server: {
handler: entryServerPath,
},
ssr: true,
vite: {
plugins: [solid({ ssr: true })],
esbuild: {
loader: 'jsx',
},
optimizeDeps: {
esbuildOptions: {
loader: {
'.js': 'jsx',
},
},
},
resolve: {
preserveSymlinks: true,
conditions: ['solid', 'development', 'browser'],
extensions: [
'.mjs',
'.js',
'.mts',
'.ts',
'.jsx',
'.tsx',
'.json',
],
alias: {
// ...
},
},
},
});
const app = defineConfig({
appRoot: path.resolve(__dirname, '../src'),
server: {
handler: entryServerPath,
},
ssr: true,
vite: {
plugins: [solid({ ssr: true })],
esbuild: {
loader: 'jsx',
},
optimizeDeps: {
esbuildOptions: {
loader: {
'.js': 'jsx',
},
},
},
resolve: {
preserveSymlinks: true,
conditions: ['solid', 'development', 'browser'],
extensions: [
'.mjs',
'.js',
'.mts',
'.ts',
'.jsx',
'.tsx',
'.json',
],
alias: {
// ...
},
},
},
});
But I'm getting this odd error:
2:11:10 PM [vite] Pre-transform error: Failed to load url @solidjs/start/server (resolved id: /home/projects/sb1-k8bui6zy/packages/app/node_modules/@solidjs/start/server) in /home/projects/sb1-k8bui6zy/packages/app/src/entry-server.tsx. Does the file exist?
example:dev: 2:11:11 PM [vite] Error when evaluating SSR module /@fs/home/projects/sb1-k8bui6zy/packages/app/src/entry-server.tsx: failed to import "@solidjs/start/server"
example:dev: |- TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".jsx" for /home/projects/sb1-k8bui6zy/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/dist/server/index.jsx
2:11:10 PM [vite] Pre-transform error: Failed to load url @solidjs/start/server (resolved id: /home/projects/sb1-k8bui6zy/packages/app/node_modules/@solidjs/start/server) in /home/projects/sb1-k8bui6zy/packages/app/src/entry-server.tsx. Does the file exist?
example:dev: 2:11:11 PM [vite] Error when evaluating SSR module /@fs/home/projects/sb1-k8bui6zy/packages/app/src/entry-server.tsx: failed to import "@solidjs/start/server"
example:dev: |- TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".jsx" for /home/projects/sb1-k8bui6zy/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/dist/server/index.jsx
Anyone got ideas? No luck so far, I've tried everything I could think of but can't get past this latest error.

Did you find this page helpful?