Cannot build for Vercel

For context So far I'm not satisfied with Solid Start because I wasn't able to deploy the app at least anywhere (I tried Vercel, Netlify and Cloudflare). But Vercel is my main target so this question is about deploying to Vercel specifically. Also I haven't really seen anyone to have the same problem as I do. How to reproduce 1. Create a new Solid Start project
npm init solid@latest
npm init solid@latest
2. Choose any template (I chose hackernews) 3. Edit your app.config.ts as follows:
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
server: {
preset: "vercel-edge",
},
});
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
server: {
preset: "vercel-edge",
},
});
4. Run npm run build Error
ERROR Cannot read properties of undefined (reading 'split')
at /F:/repos/hackernews/node_modules/@rollup/plugin-inject/dist/es/index.js:74:74
at Map.forEach (<anonymous>)
at inject (/F:/repos/hackernews/node_modules/@rollup/plugin-inject/dist/es/index.js:71:16)
at getRollupConfig (/F:/repos/hackernews/node_modules/nitropack/dist/nitro.mjs:2036:29)
at build (/F:/repos/hackernews/node_modules/nitropack/dist/nitro.mjs:2349:24)
at createBuild (/F:/repos/hackernews/node_modules/vinxi/lib/build.js:306:8)
at async Object.run (/F:/repos/hackernews/node_modules/vinxi/bin/cli.mjs:227:5)
at async runCommand (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:316:16)
at async runCommand (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:307:11)
at async runMain (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:445:7)



ERROR Cannot read properties of undefined (reading 'split')
ERROR Cannot read properties of undefined (reading 'split')
at /F:/repos/hackernews/node_modules/@rollup/plugin-inject/dist/es/index.js:74:74
at Map.forEach (<anonymous>)
at inject (/F:/repos/hackernews/node_modules/@rollup/plugin-inject/dist/es/index.js:71:16)
at getRollupConfig (/F:/repos/hackernews/node_modules/nitropack/dist/nitro.mjs:2036:29)
at build (/F:/repos/hackernews/node_modules/nitropack/dist/nitro.mjs:2349:24)
at createBuild (/F:/repos/hackernews/node_modules/vinxi/lib/build.js:306:8)
at async Object.run (/F:/repos/hackernews/node_modules/vinxi/bin/cli.mjs:227:5)
at async runCommand (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:316:16)
at async runCommand (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:307:11)
at async runMain (/F:/repos/hackernews/node_modules/citty/dist/index.mjs:445:7)



ERROR Cannot read properties of undefined (reading 'split')
32 Replies
Brendonovich
Brendonovich•5mo ago
not sure what the error is at first glance, but have you tried vercel instead of vercel-edge?
deminearchiver
deminearchiverOP•5mo ago
Using vercel gives an error after deploying to vercel.
Brendonovich
Brendonovich•5mo ago
which error?
deminearchiver
deminearchiverOP•5mo ago
Wait, let me get it.
npm add -D vercel
npm add -D vercel
npm run build
npm run build
vercel deploy --prebuilt
vercel deploy --prebuilt
Wait WHAT... It worked! BUT I've been trying to deploy to Vercel for like 2 months now and it wasn't working... I'm pretty sure I'm gonna face some issues in the future This is my first time seeing a Solid Start site deployed by me. I'll keep this thread updated if something breaks.
Brendonovich
Brendonovich•5mo ago
hm vercel-edge is working fine for me
deminearchiver
deminearchiverOP•5mo ago
That's the point, I haven't seen anyone else to have the same issues as I do. Actually I'm using yarn instead of npm if that means anything (I'm not using Yarn PNP)
Brendonovich
Brendonovich•5mo ago
i use pnpm, maybe that's got something to do with it?
deminearchiver
deminearchiverOP•5mo ago
idk... package managers shouldn't affect how things work
Brendonovich
Brendonovich•5mo ago
a lot of stuff shouldn't affect how things work 😅
deminearchiver
deminearchiverOP•5mo ago
Oh, here we go:
No description
deminearchiver
deminearchiverOP•5mo ago
Oh wait it might be an error on my side pardon me Forgot to add my vite plugins Here it is:
Unhandled Rejection: TypeError: Cannot read properties of undefined (reading 'file')
at Object.get (file:///var/task/chunks/runtime.mjs:5632:33)
at file:///var/task/chunks/runtime.mjs:6836:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
Unhandled Rejection: TypeError: Cannot read properties of undefined (reading 'file')
at Object.get (file:///var/task/chunks/runtime.mjs:5632:33)
at file:///var/task/chunks/runtime.mjs:6836:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
Brendonovich
Brendonovich•5mo ago
is that with the hackernews example or your own code?
deminearchiver
deminearchiverOP•5mo ago
basic example with a few things added, but I haven't really changed much. Here's the problematic peace in the generated runtime.mjs
No description
deminearchiver
deminearchiverOP•5mo ago
I'm using Vanilla Extract just so you know Maybe it is the cause but I will never give it up
Brendonovich
Brendonovich•5mo ago
i have a feeling it might be though people do use vanilla extract + start already
deminearchiver
deminearchiverOP•5mo ago
Yes exactly
Brendonovich
Brendonovich•5mo ago
can you make a reproduction of this?
deminearchiver
deminearchiverOP•5mo ago
Ughhh I just need to commit the repo
deminearchiver
deminearchiverOP•5mo ago
GitHub
GitHub - deminearchiver/material-solid: Material Components for Sol...
Material Components for SolidJS. Contribute to deminearchiver/material-solid development by creating an account on GitHub.
deminearchiver
deminearchiverOP•5mo ago
1. Clone 2. yarn install 3. yarn : @material-solid/docs-next build 4. yarn : @material-solid/docs-next deploy
Brendonovich
Brendonovich•5mo ago
probably worth putting those instructions in the readme if anyone else needs to look at it
deminearchiver
deminearchiverOP•5mo ago
It's work in progress... So, have you tried deploying it from your machine?
Brendonovich
Brendonovich•5mo ago
yeah i'm getting another error
deminearchiver
deminearchiverOP•5mo ago
Can you show? I have set up github actions for vercel
Brendonovich
Brendonovich•5mo ago
it's the vanilla extract plugin, removing it stops the error
deminearchiver
deminearchiverOP•5mo ago
bruhhhh My day is ruined by those news So do you think I should ask this question in the Vanilla Extract discord server / github repo?
Brendonovich
Brendonovich•5mo ago
not sure, it depends where the bug is i'd recommend making an issue on the Start repo with a minimal reproduction you could also try using panda css for now afaik it's similar to vanilla extract
deminearchiver
deminearchiverOP•5mo ago
but my whole project is using vanilla extract
Brendonovich
Brendonovich•5mo ago
unrelated to that problem but i don't think your components package has the correct exports any export that exports files with JSX should have the solid export condition that points to a jsx file
deminearchiver
deminearchiverOP•5mo ago
For now I don't have a build process the library is work in progress so for now I simply export ts files
deminearchiver
deminearchiverOP•5mo ago
GitHub
GitHub - deminearchiver/solid-start-vanilla-extract
Contribute to deminearchiver/solid-start-vanilla-extract development by creating an account on GitHub.
Want results from more Discord servers?
Add your server