My package json includes the following dependencies:
"webpack": "5.58.1",
"@sentry/nextjs": "6.13.3",
"typescript": "4.0.5",
"next": "11.0.1",
After running next build
without errors, I proceed to run next dev
and check http://localhost:3000/ in my browser.
However, the browser console shows this error:
Uncaught TypeError: Cannot read properties of undefined (reading 'cwd')
at eval (VM244 parsers.js:42)
// More error logs here...
To try and resolve this, I have updated my next.config.js
with a custom webpack configuration snippet:
config.resolve.fallback = {
"fs": false,
"os": false,
"path": false,
// Other fallback values...
};
I also attempted installing
"process": "0.11.10"
and added a plugin to webpack config as follows:
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
})
],
Unfortunately, these solutions did not work for me. Any suggestions on how to fix this runtime TypeError?