Error: Cannot find module Next.js 14 when module exists #64765
-
SummaryI get this error in dev mode and when building my Next.js app locally or on Vercel, but also in dev mode. Error: Cannot find module 'C:\Projects\project\node_modules@google-cloud\tasks\build\esm\src\v2\cloud_tasks_client_config.json' Here is what I have tried:
Here is a minimal reproduce of the problem:
My next.config.mjs doesn't contain any webpack configurations. Here is the package.json:
When I click on the 'C:\Projects\project\node_modules@google-cloud\tasks\build\esm\src\v2\cloud_tasks_client_config.json file, it leads me to the right json file inside of node_modules, so the file exists. Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
After I have tried multiple versions of I even played around with the Changing the This module always seems to have issues, I recommend staying away from it. to fix this, run:
|
Beta Was this translation helpful? Give feedback.
After I have tried multiple versions of
Next.js
and multiple different versions of@google-cloud/tasks
, the issue persisted locally and on Vercel.I even played around with the
next.config.mjs
webpack config, and cleared cache, and deletednode_modules
multiple times.Changing the
@google-cloud/tasks
version to5.1.0
fixed the issue.This module always seems to have issues, I recommend staying away from it. to fix this, run:
npm i @google-cloud/tasks@5.1.0