GithubHelp home page GithubHelp logo

Comments (9)

liuxuan30 avatar liuxuan30 commented on May 31, 2024

I came across vercel/next.js#44998 and using next.js 3.1.1 on my side indeed removes the second issue (using yarn dev). However, yours is using 3.2.4.

The first issue remains on 3.1.1 still though. Using 3.1.1 also lacks Metadata type, so I still hope we can fix this on 3.2.4

from chronark.com.

liuxuan30 avatar liuxuan30 commented on May 31, 2024

running 'next dev' (I use yarn dev basically) looks like give totally different output, it will remove below

Unhandled Runtime Error
Error: Dynamic server usage: no-store fetch https://evolving-cougar-30890.upstash.io/ /projects/[slug]

but adding new:

error - Error: Cannot find module 'next/dist/server/app-render/get-segment-param.js'
Require stack:

  • /Users/react/demo/chronark.com/.next/server/app/projects/[slug]/page.js
    at ../../server/app-render/get-segment-param (/Users/react/demo/chronark.com/.next/server/app/projects/[slug]/page.js:55:18)
    at webpack_require (/Users/react/demo/chronark.com/.next/server/webpack-runtime.js:33:42)
    at webpack_require (/Users/react/demo/chronark.com/.next/server/webpack-runtime.js:33:42)
    at webpack_require (/Users/react/demo/chronark.com/.next/server/webpack-runtime.js:33:42)
    at webpack_require (/Users/react/demo/chronark.com/.next/server/webpack-runtime.js:33:42)
    at webpack_require (/Users/react/demo/chronark.com/.next/server/webpack-runtime.js:33:42)
    at webpack_require (/Users/react/demo/chronark.com/.next/server/webpack-runtime.js:33:42)

from chronark.com.

liuxuan30 avatar liuxuan30 commented on May 31, 2024

it seems

export async function generateStaticParams(): Promise<Props["params"][]> {
	return allProjects
		.filter((p) => p.published)
		.map((p) => ({
			slug: p.slug,
		}));
}

is kind of confusing, what's the purpose here to get a static slug? I do see

export default async function PostPage({ params }: Props)

could get the slug as well

Shall we delete generateStaticParams() here?

I commented it out, and seems PostPage still could get a valid slug? even with "http://localhost:3000/projects/upstash-cli" directly, without navigation.

Not sure what's going on here.

image

from chronark.com.

chronark avatar chronark commented on May 31, 2024

generateStaticParams will build all pages statically at build time, if you omit it, then they will be built only when requested

from chronark.com.

liuxuan30 avatar liuxuan30 commented on May 31, 2024

generateStaticParams will build all pages statically at build time, if you omit it, then they will be built only when requested

but then how to deal with the errors? worth mentioning next 3.1.1 has no issue. So I'm not sure how this should be handled.

from chronark.com.

chronark avatar chronark commented on May 31, 2024

Hmm I didn't notice the errors tbh, I'll check it out this week

from chronark.com.

daallgeier avatar daallgeier commented on May 31, 2024

Actually; i believe these are connected? #14

from chronark.com.

warifp avatar warifp commented on May 31, 2024

Yay. I found the answer after 2 days of no sleep, delete dir generate ".contentlayer" and run again "pnp run build".

from chronark.com.

LucasBonafe avatar LucasBonafe commented on May 31, 2024

Hmm I didn't notice the errors tbh, I'll check it out this week

I'm having the same problem:
image

I believe they are related to the rendering of MDX files:
image

#42 is the answer!

from chronark.com.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.