I've noticed this particular error popping up frequently online, but it's not quite matching the issue I'm facing.
Every time I execute yarn dev
, I encounter the following error:
next-dev.js?53bc:89 Error was not caught TypeError: Cannot read property 'cwd' of undefined
at Module.eval (parsers.js?f09d:27)
at eval (parsers.js:252)
at Module../node_modules/@sentry/node/esm/parsers.js (_app.js?ts=1619702971940:3455)
at __webpack_require__ (webpack.js?ts=1619702971940:873)
at fn (webpack.js?ts=1619702971940:151)
at eval (backend.js?5e1f:1)
at Module../node_modules/@sentry/node/esm/backend.js (_app.js?ts=1619702971940:3299)
at __webpack_require__ (webpack.js?ts=1619702971940:873)
at fn (webpack.js?ts=1619702971940:151)
at eval (index.js?54d7:1)
at Module../node_modules/@sentry/node/esm/index.js (_app.js?ts=1619702971940:3335)
at __webpack_require__ (webpack.js?ts=1619702971940:873)
at fn (webpack.js?ts=1619702971940:151)
at Module.eval (_app.tsx:16)
at eval (_app.tsx?8548:93)
at Module../src/pages/_app.tsx (_app.js?ts=1619702971940:11957)
at __webpack_require__ (webpack.js?ts=1619702971940:873)
at fn (webpack.js?ts=1619702971940:151)
at eval (next-client-pages-loader.js?7ae7:5)
at eval (route-loader.ts?8a46:294)
enter code here
This error occurs whether I'm in development or production mode.
I'm working on a project using nextjs
, typescript
, jest
, and babel
.
It seems to be related to a babel compatibility issue, but all my packages are updated and should be compatible as per my package.json:
"@types/testing-library__jest-dom": "5.9.5",
"@babel/core": "7.13.1",
"@types/jest": "26.0.23",
"babel-jest": "26.6.3",
"jest": "26.6.3",
"ts-jest": "26.5.5",
I'm puzzled by this situation as all suggested solutions point towards package compatibility issues that don't seem to address my problem... If you need more information, feel free to ask.