hi i want deploy my nextjs app on cpanel hosting but i have a problem ...
Unanswered
Californian posted this in #help-forum
CalifornianOP
hi i want deploy my nextjs app on cpanel. i used npm run build command but there is no build folder. help me please.
125 Replies
Look in the root of your project for a .next folder
CalifornianOP
there is no build folder
do you mean, should i try to deploy this project on cpanel with .next folder?
@Californian there is no build folder
are you looking for static export?
if so, put
after you run
output: "export" in next.config.jsafter you run
next build, there will be a out folderbut look like your pages are dynamic page which will need a node server
@Ray if so, put `output: "export"` in `next.config.js`
after you run `next build`, there will be a `out` folder
CalifornianOP
i tried this and i got an a error
@Californian i tried this and i got an a error
you cant use server actions with static build, if I'm right
@Californian Click to see attachment
missing a page file in [[...sign-in]] that includes the generateStaticprops() function. also have a look at the doubled array brackets?
have a look at this thread: https://nextjs-forum.com/post/1190997120665272340
CalifornianOP
i published my app on vercel and netlify
after i published the app on vercel
it was working
i signed in
After logging in, it was supposed to redirect to the dashboard, but an error occurred.
Did you have a look in the thread I posted? seems quit similiar and could perhaps solve your problem.
I have never used vercel before.
I have never used vercel before.
@Californian it was working
the app was working?
CalifornianOP
yes it was working on my local
ah
nothing was missed n migration?
CalifornianOP
i think no
different version of next perhaps? I'm not aware of how vercel runs
@goodsie different version of next perhaps? I'm not aware of how vercel runs
CalifornianOP
It is very similar to the netlify platform
i tried to publish my app on netlify but i got same error
@goodsie different version of next perhaps? I'm not aware of how vercel runs
CalifornianOP
https://github.com/vercel/next.js/issues/43772 i found this source
error on netlify
@Californian error on netlify
this is a publishkey error
invalid url in last pic
CalifornianOP
about this environment?
@Californian Click to see attachment
have a quick peek here. Maybe help with netlify and clerk
@goodsie https://stackoverflow.com/questions/76248386/clerk-fails-to-get-the-publishable-key-from-the-environment-variables-in-next-js
CalifornianOP
I'm checking it out right away
@goodsie https://stackoverflow.com/questions/76248386/clerk-fails-to-get-the-publishable-key-from-the-environment-variables-in-next-js
CalifornianOP
i added a new single environment
CalifornianOP
i created a file "ClerkProvider.tsx" in context folder
copyed and pasted this code
I think there is something wrong here
no types on the params
are the params supposed to be destructured?
{}
if you mouse over the red squigglies, what do they say
CalifornianOP
ok, so for now lets just infer the any type for the params
children: any, pageProps: any
CalifornianOP
okay so?
well, whats happening now?
@goodsie children: any, pageProps: any
CalifornianOP
im thinking about this
CalifornianOP
how can i do this?
@Californian Click to see attachment
missing from here
@Californian Do you understand what I am saying to do?
im trying
and thats good 🙂
CalifornianOP
function ContextProviders({children: any, pageProps: any}) {...add the type infers to the parameters of the function
remove the extra in Main
CalifornianOP
like this?
yup.. whats it sayin on the squigglies now ?
CalifornianOP
cannot find name pageProps
and children
is it possible for you to paste the whole code?
CalifornianOP
do you still have the type infers on the class entries?
complete page would be very helpful 🙂
CalifornianOP
"use client";
import React from "react";
import { ClerkProvider } from "@clerk/nextjs";
function ContextProviders({ children: any, pageProps: any }) {
return (
<ClerkProvider {...pageProps} publishableKey={process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}>
{children}
</ClerkProvider>
)
}
export default ContextProvidersdo you want this code?
yup. no more class ?
CalifornianOP
ok ok
I had to do some learning
your _app file
it has this exact step
@goodsie https://clerk.com/docs/quickstarts/nextjs#wrap-your-app-in-clerk-provider
CalifornianOP
I'm checking it out right away
but i think the problem is not about that
because its working on my local
but when i publish it on vercel or netlify its not working
CalifornianOP
i found something
when i try to create a new instance for publishing "product" in Clerk (Clerk is a auth platform)
i need a domain to enter here
i type my vercel domain here
but i got a error
i want deploy my project anyway but i cant solve problems 😦
Whats your domain?
@Californian https://yt-pageform-main.vercel.app/
it says you cant use vercel.app on production builds. what is the domain you have yourself?
@goodsie it says you cant use vercel.app on production builds. what is the domain you have yourself?
CalifornianOP
i have my own domain
im using cpanel for this
but i dont now how can i deploy it on cpanel
i try this steps for deploy the project on cpanel hosting:
first "npm run build"
convert the build folder in to the zip file
upload it to cpanel via file manager
and unzip it
created a .httaccess file
but it not works
@Californian i have my own domain
dns is set correctly?
CalifornianOP
i think yes
maybe
it should contain an 'A' record that points to the servers ip
@goodsie it should contain an 'A' record that points to the servers ip
CalifornianOP
if you want i can share the project on github
Hmm. I won't be able to help much atm. But if you decide to I will promise to have a look as soon as I can.
@goodsie https://github.com/gidsola
CalifornianOP
thank you so much man 🙂 i sended link from dm
