Skip to content

Commit ddc6f83

Browse files
add FAQ for cannot find module error (vercel#695)
1 parent 9387178 commit ddc6f83

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,40 @@ After Email confirmation, Checkout should be manually enabled through BigCommerc
147147
<br>
148148
BigCommerce team has been notified and they plan to add more details about this subject.
149149
</details>
150+
151+
<details>
152+
<summary>When run locally I get `Error: Cannot find module '...@vercel/commerce/dist/config'`</summary>
153+
154+
```bash
155+
commerce/site
156+
❯ yarn dev
157+
yarn run v1.22.17
158+
$ next dev
159+
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
160+
info - Loaded env from /commerce/site/.env.local
161+
error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
162+
Error: Cannot find module '/Users/dom/work/vercel/commerce/node_modules/@vercel/commerce/dist/config.cjs'
163+
at createEsmNotFoundErr (node:internal/modules/cjs/loader:960:15)
164+
at finalizeEsmResolution (node:internal/modules/cjs/loader:953:15)
165+
at resolveExports (node:internal/modules/cjs/loader:482:14)
166+
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
167+
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
168+
at Function.mod._resolveFilename (/Users/dom/work/vercel/commerce/node_modules/next/dist/build/webpack/require-hook.js:179:28)
169+
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
170+
at Module.require (node:internal/modules/cjs/loader:1005:19)
171+
at require (node:internal/modules/cjs/helpers:102:18)
172+
at Object.<anonymous> (/Users/dom/work/vercel/commerce/site/commerce-config.js:9:14) {
173+
code: 'MODULE_NOT_FOUND',
174+
path: '/Users/dom/work/vercel/commerce/node_modules/@vercel/commerce/package.json'
175+
}
176+
error Command failed with exit code 1.
177+
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
178+
```
179+
180+
The error usually occurs when running yarn dev inside of the `/site/` folder after installing a fresh repository.
181+
182+
In order to fix this, run `yarn dev` in the monorepo root folder first.
183+
184+
> Using `yarn dev` from the root is recommended for developing, which will run watch mode on all packages.
185+
</details>
186+

0 commit comments

Comments
 (0)