[error] Client-only API called on the server side. Run client-only code in onMount, or conditionally

I everyone I'm facing this error when try to deploy my website:
[error] Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>.
Already try to deploy in two places, without success. Any idea how to identify what is causing that?
No description
5 Replies
Daniel Sousa @TutoDS
Daniel Sousa @TutoDSOP•3w ago
Anyone already face this issue?
Birk Skyum
Birk Skyum•3w ago
Do you have any options to wipe cache or recreate the lockfile? what package manager +version do you use? And what @solidjs/start and vinxi versions are you on?
Daniel Sousa @TutoDS
Daniel Sousa @TutoDSOP•3w ago
So with PNPM locally I can't reproduce this issue, but with NPM I can "@solidjs/start": "^1.0.10", "vinxi": "0.4.3", I force the 0.4.3 because of renovate this morning update to version 0.5 and breaks everything Any way to debug it? If I disable the SSR it works
Birk Skyum
Birk Skyum•3w ago
The only solution I've found so far is to delete lockfile+node_modules and install again, with varying results depending on package manager. Do you have an explicit vite version set as well?
Daniel Sousa @TutoDS
Daniel Sousa @TutoDSOP•2w ago
no :/ already did that remove everything install with NPM and have the same error that when I try to deploy it I can't found what is causing this error 😦 The strange part is if I run the build with PNPM locally works, but on vercel fails Solved, thanks @Atila I need to do the override for vite in the package.json of the project and the same for the monorepo package.json
"overrides": {
"@solidjs/start": {
"vite": "^5.0.0"
}
}
"overrides": {
"@solidjs/start": {
"vite": "^5.0.0"
}
}
Now only need to figure out why my SEO isn't working thanks @Atila and @Birk Skyum
Want results from more Discord servers?
Add your server