S
SolidJS14mo ago
Leo

Failed to build with Vite plugin and Vercel adapter.

Hi all, I'm trying to deploy my app to Vercel. I've had no luck so far (I can see the project files on Vercel's directory listing no matter what I change). I then came across the solid-start-vercel package which provides an adapter for the vite config, hoping it might work. The current vite config is as follows:
import { defineConfig } from "@solidjs/start/config";
import solid from "solid-start/vite";
import vercel from "solid-start-vercel";

export default defineConfig({
plugins: [
solid({
ssr: true,
adapter: vercel(),
}),
],
});
import { defineConfig } from "@solidjs/start/config";
import solid from "solid-start/vite";
import vercel from "solid-start-vercel";

export default defineConfig({
plugins: [
solid({
ssr: true,
adapter: vercel(),
}),
],
});
However, when I try to build with bun run build (or npm), I get the following error: "[commonjs--resolver] Missing "./dist/types/collapsible" specifier in "@kobalte/core" package". However, if I remove the solid() function from the config, it builds correctly. I am actually using solid-ui which is then using kobalte as a dependency. All packages and dependencies are at their latest version. Thanks in advance.
16 Replies
Leo
LeoOP14mo ago
Okay, I was being very stupid. I had an import to that folder, somehow, which I was not even using. I just tried to deploy it now to Vercel, but the same directory listing error occurs (it's a 404 NOT_FOUND) error. Not sure how to make it work.
bigmistqke
bigmistqke14mo ago
don't think u need the solid-start-vercel with the new solid start https://start.solidjs.com/api/vite
SolidStart Beta Documentation
SolidStart Beta Documentation
Early release documentation and resources for SolidStart Beta
albie
albie14mo ago
Maybe you need to specify noExternals as well as mentioned here https://kobalte.dev/docs/core/overview/ssr
Leo
LeoOP14mo ago
Hi @bigmistqke, @albie. I tried both of those, but still not working. I also tried both with plugins: [solid()], but same outcome
Leo
LeoOP14mo ago
Still shows the same error:
No description
Leo
LeoOP14mo ago
The vercel deployment config is set to SolidStart and the build outputs a .output and .vinxi folder, like it should, so I'm not sure why Vercel is not deploying it correctly.
Leo
LeoOP14mo ago
This is the Vercel output source:
No description
albie
albie14mo ago
Which version of solid are you using?
Leo
LeoOP14mo ago
Might be easier if I send my whole package.json:
{
"name": "web-solid",
"type": "module",
"scripts": {
"dev": "vinxi dev",
"build": "vinxi build",
"start": "vinxi start"
},
"dependencies": {
"@kobalte/core": "^0.11.2",
"@sect/solid-hiding-header": "^2.0.12",
"@solidjs/meta": "^0.29.3",
"@solidjs/router": "^0.10.5",
"@solidjs/start": "^0.4.2",
"autoprefixer": "^10.4.14",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"postcss": "^8.4.26",
"solid-icons": "^1.1.0",
"solid-js": "^1.8.7",
"solid-start": "^0.3.10",
"tailwind-merge": "^2.2.0",
"tailwindcss": "^3.4.0",
"tailwindcss-animate": "^1.0.7",
"vinxi": "0.0.59"
},
"engines": {
"node": ">=18"
}
}
{
"name": "web-solid",
"type": "module",
"scripts": {
"dev": "vinxi dev",
"build": "vinxi build",
"start": "vinxi start"
},
"dependencies": {
"@kobalte/core": "^0.11.2",
"@sect/solid-hiding-header": "^2.0.12",
"@solidjs/meta": "^0.29.3",
"@solidjs/router": "^0.10.5",
"@solidjs/start": "^0.4.2",
"autoprefixer": "^10.4.14",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"postcss": "^8.4.26",
"solid-icons": "^1.1.0",
"solid-js": "^1.8.7",
"solid-start": "^0.3.10",
"tailwind-merge": "^2.2.0",
"tailwindcss": "^3.4.0",
"tailwindcss-animate": "^1.0.7",
"vinxi": "0.0.59"
},
"engines": {
"node": ">=18"
}
}
albie
albie14mo ago
I got it to work using vinxi build —preset vercel But actions are not working properly with SSR, still trying to understand why.
Leo
LeoOP14mo ago
I'll try that now, thanks
albie
albie14mo ago
I think that in your vite configuration you don’t need neither solid nor the vercel adapter
Leo
LeoOP14mo ago
well, that did something different at least 😅
No description
Leo
LeoOP14mo ago
oh, i remember this error: SyntaxError: The requested module 'seroval' does not provide an export named 'createStream' There are two seroval folders created (2 different versions) as shown when the app is built.
No description
Leo
LeoOP14mo ago
which is causing a conflict
Leo
LeoOP14mo ago
well that's fun...
No description

Did you find this page helpful?