Client side errors out when using SSR
Domain: https://sticksdev.tech/ (click on projects and any project)
Source page: https://github.com/SticksDev/portfolio-new/blob/main/app/projects/%5Bslug%5D/page.tsx
It errors out with the "Application error: a client-side exception has occurred (see the browser console for more information)."
No useful info in console. What am I doing wrong :(
GitHub
portfolio-new/app/projects/[slug]/page.tsx at main · SticksDev/port...
Next.JS Portillo . Contribute to SticksDev/portfolio-new development by creating an account on GitHub.
3 Replies
Hello, it looks like you're trying to use MDX in an edge runtime page. This uses dynamic function evaluation, i.e.
new Function
, which is not permitted on Workers, and the use of this code is what's leading to the error. You could opt the route out of the edge runtime so that the pages are statically generated for each of your projects instead.
If you do opt it out of the edge runtime, you will also need to export a route segment config option to tell Next.js to only generate pages for the params provided in generateStaticParams
, and to not create a fallback nodejs lambda function. This can be done with:
wicked, letting this build and will let you know if this works
It worked!
Glad to hear 😄