79544492

Date: 2025-03-30 11:14:21
Score: 1
Natty:
Report link

If anyone else encounters the same issue, to fix it, add the following line to the package.json: ' type": "module", under version or name.

Also, next.config.js needs to be either .js or mjs; ts or mts won't work.

After all of this, you still need to use the code from the question to generate the static pages using the function generateStaticParams. It needs to be named generateStaticParams.

Also, instead of using the nextjs dynamic routes with [slug] I think it's better to just use query like in the answer from @Yahya Aghdam

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Yahya
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Oliver