Skip to content

Commit e55509b

Browse files
committed
[Landing] Custom error page (fix next export error)
404.html TypeError: ctx.renderPage is not a function
1 parent 8a8aef2 commit e55509b

3 files changed

Lines changed: 40 additions & 12 deletions

File tree

landing/pages/_changelog.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

landing/pages/_error.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { NextPage } from 'next'
2+
3+
import { LogoHead } from '../src/components/common/LogoHead'
4+
import LandingLayout from '../src/components/layouts/LandingLayout'
5+
6+
export interface ErrorPageProps {}
7+
8+
const Error: NextPage<ErrorPageProps> = () => {
9+
return (
10+
<LandingLayout>
11+
<section id="error" className="container">
12+
<LogoHead />
13+
14+
<div className="flex flex-col items-center m-auto text-center">
15+
<h1 className="text-3xl sm:text-4xl whitespace-no-wrap">
16+
Oops, try another page
17+
</h1>
18+
</div>
19+
</section>
20+
</LandingLayout>
21+
)
22+
}
23+
24+
export default Error

landing/pages/pricing.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
import { NextPage } from 'next'
22

3+
import { setPublicPlansCache } from '../src/context/PlansContext'
34
import PricingPage from '../src/pages/PricingPage'
45

56
export interface PricingPageProps {}
67

7-
const Pricing: NextPage<PricingPageProps> = () => {
8+
const Pricing: NextPage<PricingPageProps> = props => {
9+
console.log('xxx pricing page', props)
810
return <PricingPage />
911
}
1012

1113
export default Pricing
14+
15+
export function unstable_getStaticProps() {
16+
setPublicPlansCache(value => ({
17+
...value,
18+
freeTrialDays: 1234,
19+
}))
20+
21+
return {
22+
props: {
23+
test: 1234,
24+
},
25+
}
26+
}

0 commit comments

Comments
 (0)