Subpath './server.edge' is not defined by "exports".... this causes internal server error

My project works fine in development but when I deployed my site and viewed it i saw a status code of 500 (internal server error)

I found the following error when I looked at the function logs

Sep 11, 04:48:21 PM: 10b04717 ERROR Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './server.edge' is not defined by "exports" in /var/task/node_modules/react-dom/package.json

The code for this site is available on github

Is there any way to fix this?

The error message indicates that the package subpath ‘./server.edge’ is not defined in your ‘react-dom’ package.json file.

Check out a similar thread…