[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?
5 Replies
Anyone already face this issue?
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?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 worksThe 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?
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
Now only need to figure out why my SEO isn't working
thanks @Atila and @Birk Skyum