transitive-bullshit / nextjs-notion-starter-kit

Deploy your own Notion-powered website in minutes with Next.js and Vercel.
https://transitivebullsh.it/nextjs-notion-starter-kit
MIT License
6.16k stars 5.23k forks source link

Minified react errors #425, #418, #423 post-build/deploy on Vercel. #462

Open engageintellect opened 1 year ago

engageintellect commented 1 year ago

Description

I get no errors in dev environment, only after building. Seems to happen regardless of the content in my pages. image

Notion Test Page ID

2e801532a8be488b8c4b0d5f1a145a1b

This is extremely helpful for us to debug and fix issues.

Thanks! -->

HSeongJ commented 1 month ago

I solved the issue using the following method. Try these steps in order.

1. Install dayjs from npm.

npm i dayjs

2. To set the desired timezone and format, modify site.config.ts. (You need to add the type to @/lib/site-config.ts).

site-config.ts

image

site.config.ts

image

3. To use dayjs on the server side, create a module. (Create a .ts file in the @/lib folder, e.g., get-date-tz.ts).

image

4. Add items to config.ts

image

5. Write the propertyCreatedTimeValue function in the NotionPage.tsx file.

image

6. Add the propertyCreatedTimeValue function to the components variable.

image