Next.js Discord

Discord Forum

I am facing this problem during build after adding "output: 'export'" to next config

Unanswered
CharanReddy404 posted this in #help-forum
Open in Discord
I am facing this problem during build after adding "output: 'export'" to next config. can anyone help me out with this

40 Replies

@Ray clerk doesn't work with static export
not only clerk for all dynamic routes its giving the same error
@CharanReddy404 not only clerk for all dynamic routes its giving the same error
you have to use generateStaticParams to generate all the path at build time for the dynamic route
@Ray you have to use `generateStaticParams` to generate all the path at build time for the dynamic route
is there any way to bypass this because i don't know what params should i use for clerk routes
you can export generateStaticParams with an empty array return
like this ?
which mean no page is generated for that route
@CharanReddy404 like this ?
what is this page for?
for SignIn using Clerk
it is not gonna work
alternative ?
auth0, aws cognito, firebase auth
nextAuth ?
no
i want convert my next js app in to android and ios app using capacitorjs
@CharanReddy404 i want convert my next js app in to android and ios app using capacitorjs
then you should have an api for authenticate instead
@Ray auth0, aws cognito, firebase auth
or this
Okay
@CharanReddy404 Okay
but I think clerk should works too
@CharanReddy404 Okay
try change the path to app/(auth)/sign-in/page.tsx
How ?
ok let me check
if it doesn't work, try this
import { UserButton } from "@clerk/nextjs";
 
export default function Home() {
  return (
    <div className="h-screen">
      <UserButton afterSignOutUrl="/"/>
    </div>
  )
}
lot of error
i am getting a new error with clerk
UserButton should work
Signin may not work
@Ray auth0, aws cognito, firebase auth
ok let me try this
oh UserButton doesn't work too?
⨯ Middleware cannot be used with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export
@Ray https://clerk.com/docs/quickstarts/react I think you can try this
try using @clerk/clerk-react
<ClerkProvider publishableKey={node.env.NEXT_PUBLIC_PUBLISHABLE_KEY}>
you don't need this
// Import your publishable key
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY
 
if (!PUBLISHABLE_KEY) {
  throw new Error("Missing Publishable Key")
}
ok let me explore