How to solve internal server error for next.js on stackblitz?

Viewed 32

I'm trying to create a simple example for a problem I have in NextJS.

The problem is that it encountered an error, showed Internal Server Error and now I'm stuck at how to make it work.

I retried many times. But each time somewhere it encounters this error and never recovers.

Here's an example:

https://stackblitz.com/edit/nextjs-9zbx4x?file=cache.js

How can I fix this error?

1 Answers

As it states on console error:

Error: [BABEL] /home/projects/nextjs-9zbx4x/node_modules/next/dist/client/dev/amp-dev.js: Cannot find module 'babel-plugin-macros'

You need to add babel-plugin-macros dependency in dependencies section of your package.json like this:

"babel-plugin-macros": "3.1.0",

You can take a look at this forked stackblitz for the live working update with babel-plugin-macros dependency.

Related