turbo
turbo copied to clipboard
[Turbopack] Error resolving commonjs request
What version of Turbopack are you using?
included in [email protected]
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Describe the Bug
I get the following stack trace when I start my next application with next dev --turbo --show-all
and I try to load a page.
The page doesn't load.
thread 'tokio-runtime-worker' panicked at 'not yet implemented: emit an error for this case: apply need to be used', /Users/runner/.cargo/git/checkouts/turbo-df7a549334890fa5/5603994/crates/turbopack-ecmascript/src/references/pattern_mapping.rs:85:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at 'not yet implemented: emit an error for this case: apply need to be used', /Users/runner/.cargo/git/checkouts/turbo-df7a549334890fa5/5603994/crates/turbopack-ecmascript/src/references/pattern_mapping.rs:85:17
thread 'tokio-runtime-worker' panicked at 'not yet implemented: emit an error for this case: apply need to be used', /Users/runner/.cargo/git/checkouts/turbo-df7a549334890fa5/5603994/crates/turbopack-ecmascript/src/references/pattern_mapping.rs:85:17
thread 'tokio-runtime-worker' panicked at 'not yet implemented: emit an error for this case: apply need to be used', /Users/runner/.cargo/git/checkouts/turbo-df7a549334890fa5/5603994/crates/turbopack-ecmascript/src/references/pattern_mapping.rs:85:17
thread 'tokio-runtime-worker' panicked at 'not yet implemented: emit an error for this case: apply need to be used', /Users/runner/.cargo/git/checkouts/turbo-df7a549334890fa5/5603994/crates/turbopack-ecmascript/src/references/pattern_mapping.rs:85:17
thread 'tokio-runtime-worker' panicked at 'not yet implemented: emit an error for this case: apply need to be used', /Users/runner/.cargo/git/checkouts/turbo-df7a549334890fa5/5603994/crates/turbopack-ecmascript/src/references/pattern_mapping.rs:85:17
thread 'tokio-runtime-worker' panicked at 'not yet implemented: emit an error for this case: apply need to be used', /Users/runner/.cargo/git/checkouts/turbo-df7a549334890fa5/5603994/crates/turbopack-ecmascript/src/references/pattern_mapping.rs:85:17
thread 'tokio-runtime-worker' panicked at 'not yet implemented: emit an error for this case: apply need to be used', /Users/runner/.cargo/git/checkouts/turbo-df7a549334890fa5/5603994/crates/turbopack-ecmascript/src/references/pattern_mapping.rs:85:17
error -
[resolve]
/Users/leonard/code/capsule/node_modules/.pnpm/@[email protected]/node_modules/@sentry/cli/js/helper.js
Error resolving commonjs request
unable to resolve dynamic
/Users/leonard/code/capsule/node_modules/.pnpm/@[email protected]/node_modules/@sentry/cli/js/helper.js
Error resolving commonjs request
unable to resolve dynamic
/Users/leonard/code/capsule/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/xhr
Error resolving server relative import: not implemented yet
unable to resolve server relative "/ROOT/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js"
/Users/leonard/code/capsule/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js
Error resolving commonjs request
unable to resolve server relative "/ROOT/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js" or module "null"
/Users/leonard/code/capsule/node_modules/.pnpm/[email protected]/node_modules/jsdom/lib/jsdom/utils.js
Error resolving commonjs request
unable to resolve module "canvas"
/Users/leonard/code/capsule/node_modules/.pnpm/[email protected]/node_modules/node-fetch/lib/index.mjs
Error resolving commonjs request
unable to resolve module "encoding"
/Users/leonard/code/capsule/node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js
Error resolving commonjs request
unable to resolve module "bufferutil"
/Users/leonard/code/capsule/node_modules/.pnpm/[email protected]/node_modules/ws/lib/validation.js
Error resolving commonjs request
unable to resolve module "utf-8-validate"
Expected Behavior
I would expect to be able to load a page as like when I use next dev
.
To Reproduce
Not sure how to reproduce but it might be relevant to add some context:
- I use turbo 1.6.1
- I use pnpm workspace
Reproduction Repo
No response
Came here looking to see if anyone else had the same issue. Also get these using next dev turbo --show-all
after trying upgrading a next 12 project to 13. With next dev
and no turbo
, everything ok.
event - initial compilation 7.082ms
error - [resolve]
node_modules/source-map-support/source-map-support.js
Error resolving commonjs request
unable to resolve module "fs"
Error resolving commonjs request
unable to resolve module "path"
node_modules/typescript/lib/typescript.js
Error resolving commonjs request
unable to resolve dynamic
Error resolving commonjs request
unable to resolve dynamic or dynamic or relative "./node_modules/@microsoft/typescript-etw"
Error resolving commonjs request
unable to resolve module "crypto"
Error resolving commonjs request
unable to resolve module "fs"
Error resolving commonjs request
unable to resolve module "inspector"
Error resolving commonjs request
unable to resolve module "os"
Error resolving commonjs request
unable to resolve module "path"
Error resolving commonjs request
unable to resolve module "perf_hooks"
I tried to enable turbo and encountered similar issues with the google-auth-library
dependency introduced by @google-cloud/firestore
and @google-cloud/storage
details
error -
[rendering]
[root of the dev server]/
Error during SSR Rendering
TypeError: The "superCtor.prototype" property must be of type object. Received undefined
at new NodeError (node:internal/errors:393:5)
at Module.inherits (node:util:244:11)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:39:5)
at [project-with-next]/node_modules/.pnpm/[email protected]/node_modules/jws/lib/data-stream.js (ecmascript) (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:23286:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:3:17)
at [project-with-next]/node_modules/.pnpm/[email protected]/node_modules/jws/lib/sign-stream.js (ecmascript) (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:23136:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:2:17)
at [project-with-next]/node_modules/.pnpm/[email protected]/node_modules/jws/index.js (ecmascript) (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:23070:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:12:12)
at [project-with-next]/node_modules/.pnpm/[email protected]/node_modules/gtoken/build/src/index.js (ecmascript) (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:4521:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:17:17)
at [project-with-next]/node_modules/.pnpm/[email protected]/node_modules/google-auth-library/build/src/auth/jwtclient.js (ecmascript) (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:1814:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:27:20)
at [project-with-next]/node_modules/.pnpm/[email protected]/node_modules/google-auth-library/build/src/auth/googleauth.js (ecmascript) (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:1200:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:17:21)
at [project-with-next]/node_modules/.pnpm/[email protected]/node_modules/google-auth-library/build/src/index.js (ecmascript) (.next/server/pages/chunks/node_modules__f84d28.pnpm.js:684:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__70cc5f.pnpm.js:25:30)
at [project-with-next]/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js (ecmascript) (.next/server/pages/chunks/node_modules__70cc5f.pnpm.js:7511:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__70cc5f.pnpm.js:21:15)
at [project-with-next]/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/storage/build/src/nodejs-common/service.js (ecmascript) (.next/server/pages/chunks/node_modules__70cc5f.pnpm.js:6847:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__70cc5f.pnpm.js:4:16)
at [project-with-next]/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/storage/build/src/nodejs-common/index.js (ecmascript) (.next/server/pages/chunks/node_modules__70cc5f.pnpm.js:5630:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__70cc5f.pnpm.js:17:24)
at [project-with-next]/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/storage/build/src/bucket.js (ecmascript) (.next/server/pages/chunks/node_modules__70cc5f.pnpm.js:3429:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at commonJsRequire (.next/server/pages/chunks/_0dcc32.js:2867:12)
at Object.<anonymous> (.next/server/pages/chunks/node_modules__70cc5f.pnpm.js:31:15)
at [project-with-next]/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/storage/build/src/index.js (ecmascript) (.next/server/pages/chunks/node_modules__70cc5f.pnpm.js:2593:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at esmImport (.next/server/pages/chunks/_0dcc32.js:2852:20)
at <unknown> (.next/server/pages/chunks/_b3b332.js:1:0)
at [project-with-next]/db/index.ts (ecmascript) (.next/server/pages/chunks/_b3b332.js:1611:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at esmImport (.next/server/pages/chunks/_0dcc32.js:2852:20)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:2:0)
at [project-with-next]/pages/index.tsx (ecmascript) (.next/server/pages/chunks/_0dcc32.js:317:3)
at <unknown> (.next/server/pages/chunks/_0dcc32.js:3043:21)
at runModuleExecutionHooks (.next/server/pages/chunks/_0dcc32.js:3081:5)
at instantiateModule (.next/server/pages/chunks/_0dcc32.js:3042:5)
at getOrInstantiateModuleFromParent (.next/server/pages/chunks/_0dcc32.js:3123:12)
at esmImport (.next/server/pages/chunks/_0dcc32.js:2852:20)
[resolve]
node_modules/.pnpm/[email protected]/node_modules/google-auth-library/build/src/auth/pluggable-auth-handler.js
Error resolving commonjs request
unable to resolve dynamic
node_modules/.pnpm/[email protected]/node_modules/node-fetch/lib/index.mjs
Error resolving commonjs request
unable to resolve module "encoding"
[typescript]
node_modules/.pnpm/[email protected]/node_modules/protobufjs/tsconfig.json
An issue occurred while parsing a tsconfig.json file.
tsconfig is not parseable: invalid JSON
Similar issue using EventEmitter
default export, steps to reproduce: ([email protected] / [email protected])
$ npx create-next-app@latest turbo-test
$ cd turbo-test
$ echo "const EventEmitter = require('events');\nexport class Foo extends EventEmitter {}" >> pages/index.js
$ next dev --turbo
...
error - [rendering] [root of the dev server]/
Error during SSR Rendering
TypeError: Class extends value #<Object> is not a constructor or null
at <unknown> (.next/server/pages/chunks/pages_index.js:73:25)
...
The error goes away when I change to the named export const { EventEmitter } = require('events');
The default cjs export for EventEmitter is here https://github.com/nodejs/node/blob/v16.18.0/lib/events.js#L215
I think there are a few issues being reported here.
- Node stdlib requires/imports are failing
- Highly dynamic requires/imports are failing
I think we can get stdlib imports to work in SSR, and should stop that error from reporting. If you use it in client side, then we need to still warn.
For the dynamic requires (it's using eval!), this is challenging to support. Again, we could just let node handle it, but that'll break if you're trying to do a relative require (this case requires a node_module
, which would work ok).
Came here looking to see if anyone else had the same issue. Also get these using
next dev turbo --show-all
after trying upgrading a next 12 project to 13. Withnext dev
and noturbo
, everything ok.event - initial compilation 7.082ms error - [resolve] node_modules/source-map-support/source-map-support.js Error resolving commonjs request unable to resolve module "fs" Error resolving commonjs request unable to resolve module "path" node_modules/typescript/lib/typescript.js Error resolving commonjs request unable to resolve dynamic Error resolving commonjs request unable to resolve dynamic or dynamic or relative "./node_modules/@microsoft/typescript-etw" Error resolving commonjs request unable to resolve module "crypto" Error resolving commonjs request unable to resolve module "fs" Error resolving commonjs request unable to resolve module "inspector" Error resolving commonjs request unable to resolve module "os" Error resolving commonjs request unable to resolve module "path" Error resolving commonjs request unable to resolve module "perf_hooks"
Had the same issue, removing my tsconfig.json
file seemed to resolve the issue.
Any news on this? Removing tsconfig.json
does not seem like an optimal fix.
with latest 13.4.0, still have error:
error - [resolve] node_modules/.pnpm/[email protected]/node_modules/opener/lib/opener.js
node_modules/.pnpm/[email protected]/node_modules/opener/lib/opener.js:65:12 Error resolving commonjs request
61 | });
62 | args = ["/c", "start", "\"\""].concat(args);
63 | }
64 |
+ v-----------------------------------------------------v
65 + return childProcess.execFile(command, args, options, callback);
+ ^-----------------------------------------------------^
66 | };
67 |
unable to resolve dynamic or dynamic or dynamic
warning -
[parse]
node_modules/.pnpm/[email protected]/node_modules/gzip-size/index.js
node_modules/.pnpm/[email protected]/node_modules/gzip-size/index.js:49:17 lint TP1004 fs.createReadStream(???*0*) is very dynamic
45 | };
46 |
47 | module.exports.file = (path, options) => {
48 | return new Promise((resolve, reject) => {
+ v
49 + const stream = fs.createReadStream(path);
+ ^
50 | stream.on('error', reject);
51 |
52 | const gzipStream = stream.pipe(module.exports.stream(options));
53 | gzipStream.on('error', reject);
- *0* path
⚠️ pattern without value
node_modules/.pnpm/[email protected]/node_modules/gzip-size/index.js:58:65 lint TP1004 fs.readFileSync(???*0*) is very dynamic
54 | gzipStream.on('gzip-size', resolve);
55 | });
56 | };
57 |
+ v
58 + module.exports.fileSync = (path, options) => module.exports.sync(fs.readFileSync(path), options);
+ ^
59 |
- *0* path
⚠️ pattern without value
node_modules/.pnpm/[email protected]/node_modules/opener/lib/opener.js
node_modules/.pnpm/[email protected]/node_modules/opener/lib/opener.js:65:11 lint TP1005 child_process.execFile(
61 | });
62 | args = ["/c", "start", "\"\""].concat(args);
63 | }
64 |
+ v
65 + return childProcess.execFile(command, args, options, callback);
+ ^
66 | };
67 |
(???*0* | "cmd.exe" | "open" | "xdg-open" | ???*1* | FreeVar(undefined) | ???*3*),
(???*4* | [???*5*] | ???*6* | ???*9*),
(???*11* | {}),
(???*12* | {})
) is very dynamic
- *0* command
⚠️ pattern without value
- *1* ???*2*["command"]
⚠️ unknown object
- *2* arguments[1]
⚠️ function calls are not analysed yet
- *3* unknown mutation
- *4* arguments[0]
⚠️ function calls are not analysed yet
- *5* args
⚠️ circular variable reference
- *6* ???*7*(???*8*)
⚠️ unknown callee
- *7* [(??? | FreeVar(undefined) | ???)]["concat"]
⚠️ non-num constant property on array
- *8* args
⚠️ circular variable reference
- *9* ???*10*["map"](*anonymous function 2149*)
⚠️ unknown callee object
- *10* args
⚠️ circular variable reference
- *11* arguments[1]
⚠️ function calls are not analysed yet
- *12* arguments[2]
⚠️ function calls are not analysed yet
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js:43:29 lint TP1004 fs.existsSync((???*0* | ???*1*)) is very dynamic
39 | let i=0, arr=toAssume(uri, extns);
40 | let abs, stats, name, headers;
41 | for (; i < arr.length; i++) {
42 | abs = normalize(join(dir, name=arr[i]));
+ v
43 + if (abs.startsWith(dir) && fs.existsSync(abs)) {
+ ^
44 | stats = fs.statSync(abs);
45 | if (stats.isDirectory()) continue;
46 | headers = toHeaders(name, stats, isEtag);
47 | headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
- *0* abs
⚠️ pattern without value
- *1* ???*2*(join(dir, ???*4*))
⚠️ unknown callee
- *2* path*3*["normalize"]
⚠️ unsupported property on Node.js path module
- *3* path: The Node.js path module: https://nodejs.org/api/path.html
- *4* unsupported expression
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js:44:11 lint TP1004 fs.statSync((???*0* | ???*1*)) is very dynamic
40 | let abs, stats, name, headers;
41 | for (; i < arr.length; i++) {
42 | abs = normalize(join(dir, name=arr[i]));
43 | if (abs.startsWith(dir) && fs.existsSync(abs)) {
+ v
44 + stats = fs.statSync(abs);
+ ^
45 | if (stats.isDirectory()) continue;
46 | headers = toHeaders(name, stats, isEtag);
47 | headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
48 | return { abs, stats, headers };
- *0* abs
⚠️ pattern without value
- *1* ???*2*(join(dir, ???*4*))
⚠️ unknown callee
- *2* path*3*["normalize"]
⚠️ unsupported property on Node.js path module
- *3* path: The Node.js path module: https://nodejs.org/api/path.html
- *4* unsupported expression
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js:88:1 lint TP1004 fs.createReadStream(???*0*, {}) is very dynamic
84 | headers['Accept-Ranges'] = 'bytes';
85 | }
86 |
87 | res.writeHead(code, headers);
+ v
88 + fs.createReadStream(file, opts).pipe(res);
+ ^
89 | }
90 |
91 | const ENCODING = {
92 | '.br': 'br',
- *0* arguments[2]
⚠️ function calls are not analysed yet
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js:43:29 lint TP1004 fs.existsSync((???*0* | ???*1*)) is very dynamic
39 | let i=0, arr=toAssume(uri, extns);
40 | let abs, stats, name, headers;
41 | for (; i < arr.length; i++) {
42 | abs = normalize(join(dir, name=arr[i]));
+ v
43 + if (abs.startsWith(dir) && fs.existsSync(abs)) {
+ ^
44 | stats = fs.statSync(abs);
45 | if (stats.isDirectory()) continue;
46 | headers = toHeaders(name, stats, isEtag);
47 | headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
- *0* abs
⚠️ pattern without value
- *1* ???*2*(join(dir, ???*4*))
⚠️ unknown callee
- *2* path*3*["normalize"]
⚠️ unsupported property on Node.js path module
- *3* path: The Node.js path module: https://nodejs.org/api/path.html
- *4* unsupported expression
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js:44:11 lint TP1004 fs.statSync((???*0* | ???*1*)) is very dynamic
40 | let abs, stats, name, headers;
41 | for (; i < arr.length; i++) {
42 | abs = normalize(join(dir, name=arr[i]));
43 | if (abs.startsWith(dir) && fs.existsSync(abs)) {
+ v
44 + stats = fs.statSync(abs);
+ ^
45 | if (stats.isDirectory()) continue;
46 | headers = toHeaders(name, stats, isEtag);
47 | headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
48 | return { abs, stats, headers };
- *0* abs
⚠️ pattern without value
- *1* ???*2*(join(dir, ???*4*))
⚠️ unknown callee
- *2* path*3*["normalize"]
⚠️ unsupported property on Node.js path module
- *3* path: The Node.js path module: https://nodejs.org/api/path.html
- *4* unsupported expression
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js:88:1 lint TP1004 fs.createReadStream(???*0*, {}) is very dynamic
84 | headers['Accept-Ranges'] = 'bytes';
85 | }
86 |
87 | res.writeHead(code, headers);
+ v
88 + fs.createReadStream(file, opts).pipe(res);
+ ^
89 | }
90 |
91 | const ENCODING = {
92 | '.br': 'br',
- *0* arguments[2]
⚠️ function calls are not analysed yet
node_modules/.pnpm/[email protected]/node_modules/webpack-bundle-analyzer/lib/analyzer.js
node_modules/.pnpm/[email protected]/node_modules/webpack-bundle-analyzer/lib/analyzer.js:179:20 lint TP1004 fs.readFileSync(???*0*, "utf8") is very dynamic
175 | });
176 | }
177 |
178 | function readStatsFromFile(filename) {
+ v
179 + return JSON.parse(fs.readFileSync(filename, 'utf8'));
+ ^
180 | }
181 |
182 | function getChildAssetBundles(bundleStats, assetName) {
183 | return (bundleStats.children || []).find(c => _(c.assetsByChunkName).values().flatten().includes(assetName));
- *0* arguments[0]
⚠️ function calls are not analysed yet
node_modules/.pnpm/[email protected]/node_modules/webpack-bundle-analyzer/lib/parseUtils.js
node_modules/.pnpm/[email protected]/node_modules/webpack-bundle-analyzer/lib/parseUtils.js:16:18 lint TP1004 fs.readFileSync(???*0*, "utf8") is very dynamic
12 | parseBundle
13 | };
14 |
15 | function parseBundle(bundlePath) {
+ v
16 + const content = fs.readFileSync(bundlePath, 'utf8');
+ ^
17 | const ast = acorn.parse(content, {
18 | sourceType: 'script',
19 | // I believe in a bright future of ECMAScript!
20 | // Actually, it's set to `2050` to support the latest ECMAScript version that currently exists.
- *0* arguments[0]
⚠️ function calls are not analysed yet
[resolve]
node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js
node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js:105:22 Error resolving commonjs request
101 | return buf;
102 | }
103 |
104 | try {
+ v-------------------v
105 + const bufferUtil = require('bufferutil');
+ ^-------------------^
106 | const bu = bufferUtil.BufferUtil || bufferUtil;
107 |
108 | module.exports = {
109 | concat,
unable to resolve module "bufferutil"
node_modules/.pnpm/[email protected]/node_modules/ws/lib/validation.js
node_modules/.pnpm/[email protected]/node_modules/ws/lib/validation.js:86:21 Error resolving commonjs request
82 | return true;
83 | }
84 |
85 | try {
+ v-----------------------v
86 + let isValidUTF8 = require('utf-8-validate');
+ ^-----------------------^
87 |
88 | /* istanbul ignore if */
89 | if (typeof isValidUTF8 === 'object') {
90 | isValidUTF8 = isValidUTF8.Validation.isValidUTF8; // utf-8-validate@<3.0.0
unable to resolve module "utf-8-validate"
node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js
node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js:117:24 Error resolving commonjs request
113 |
114 | /* istanbul ignore else */
115 | if (!process.env.WS_NO_BUFFER_UTIL) {
116 | try {
+ v-------------------v
117 + const bufferUtil = require('bufferutil');
+ ^-------------------^
118 |
119 | module.exports.mask = function (source, mask, output, offset, length) {
120 | if (length < 48) _mask(source, mask, output, offset, length);
121 | else bufferUtil.mask(source, mask, output, offset, length);
unable to resolve module "bufferutil"
node_modules/.pnpm/[email protected]/node_modules/ws/lib/validation.js
node_modules/.pnpm/[email protected]/node_modules/ws/lib/validation.js:122:25 Error resolving commonjs request
118 | return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
119 | };
120 | } /* istanbul ignore else */ else if (!process.env.WS_NO_UTF_8_VALIDATE) {
121 | try {
+ v-----------------------v
122 + const isValidUTF8 = require('utf-8-validate');
+ ^-----------------------^
123 |
124 | module.exports.isValidUTF8 = function (buf) {
125 | return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
126 | };
unable to resolve module "utf-8-validate"
event - 2 requests (GET /, ...) 1106ms
[404] /login (630ms)
event - 2 requests (GET /_next/static/chunks/_4cbf18._.js, ...) 631ms
event - 14 requests (GET /favicon.ico, ...) 729ms
[404] /favicon.ico (161ms)
There's some bad presentation for the error logs, but the core issue is:
node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js
node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js:117:24 Error resolving commonjs request
113 |
114 | /* istanbul ignore else */
115 | if (!process.env.WS_NO_BUFFER_UTIL) {
116 | try {
+ v-------------------v
117 + const bufferUtil = require('bufferutil');
+ ^-------------------^
118 |
119 | module.exports.mask = function (source, mask, output, offset, length) {
120 | if (length < 48) _mask(source, mask, output, offset, length);
121 | else bufferUtil.mask(source, mask, output, offset, length);
unable to resolve module "bufferutil"
node_modules/.pnpm/[email protected]/node_modules/ws/lib/validation.js
node_modules/.pnpm/[email protected]/node_modules/ws/lib/validation.js:122:25 Error resolving commonjs request
118 | return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
119 | };
120 | } /* istanbul ignore else */ else if (!process.env.WS_NO_UTF_8_VALIDATE) {
121 | try {
+ v-----------------------v
122 + const isValidUTF8 = require('utf-8-validate');
+ ^-----------------------^
123 |
124 | module.exports.isValidUTF8 = function (buf) {
125 | return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
126 | };
unable to resolve module "utf-8-validate"
The childProcess.execFile
and related "very dynamic" should be warnings, I'm not sure why they're presented with the actual errors above.
I have the same issue :
Warning: Webpack is configured while Turbopack is not, which may cause problems.
See instructions if you need to configure Turbopack:
https://turbo.build/pack/docs/features/customizing-turbopack
Learn more about Next.js v13 and Turbopack: https://nextjs.link/with-turbopack
Please direct feedback to: https://nextjs.link/turbopack-feedback
ready - started server on [::]:3000, url: http://localhost:3000
error - [resolve] node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-intl/plugin.js
node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-intl/plugin.js:50:50 Error resolving commonjs request
46 | }
47 |
48 | return Object.assign({}, nextConfig, {
49 | webpack(config, options) {
+ v-----------------------v
50 + config.resolve.alias['next-intl/config'] = require.resolve(i18nPath);
+ ^-----------------------^
51 |
52 | if (typeof nextConfig.webpack === 'function') {
53 | return nextConfig.webpack(config, options);
54 | }
unable to resolve dynamic or dynamic or dynamic
warning - [parse] node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-intl/plugin.js
node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-intl/plugin.js:10:9 lint TP1004 fs.existsSync((???*0* | ???*1* | ???*2*)) is very dynamic
6 | function initPlugin(i18nPath, nextConfig) {
7 | if (i18nPath) {
8 | i18nPath = path.resolve(i18nPath);
9 |
+ v
10 + if (!fs.existsSync(i18nPath)) {
+ ^
11 | throw new Error(
12 | `Could not find i18n config at ${i18nPath}, please provide a valid path.`
13 | );
14 | }
- *0* arguments[0]
⚠️ function calls are not analysed yet
- *1* i18nPath
⚠️ circular variable reference
- *2* ???*3*((...) => fs["existsSync"](cur))
⚠️ unknown callee
- *3* [???, ???, ???, ???, ???, ???, ???, ???]["find"]
⚠️ non-num constant property on array
node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-intl/plugin.js:26:20 lint TP1006 path.resolve(???*0*) is very dynamic
22 | './src/i18n.ts',
23 | './src/i18n.js',
24 | './src/i18n.jsx'
25 | ]
+ v
26 + .map((cur) => path.resolve(cur))
+ ^
27 | .find((cur) => fs.existsSync(cur));
28 |
29 | if (!i18nPath) {
30 | throw new Error(`\n\nCould not locate i18n config. Create one at \`./(src/)i18n.{js,jsx,ts,tsx}\` or specify a custom location:
- *0* cur
⚠️ pattern without value
node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-intl/plugin.js:27:21 lint TP1004 fs.existsSync(???*0*) is very dynamic
23 | './src/i18n.js',
24 | './src/i18n.jsx'
25 | ]
26 | .map((cur) => path.resolve(cur))
+ v
27 + .find((cur) => fs.existsSync(cur));
+ ^
28 |
29 | if (!i18nPath) {
30 | throw new Error(`\n\nCould not locate i18n config. Create one at \`./(src/)i18n.{js,jsx,ts,tsx}\` or specify a custom location:
31 |
- *0* cur
⚠️ pattern without value
node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-intl/plugin.js:50:49 lint TP1003 require.resolve((???*0* | ???*1* | ???*2*)) is very dynamic
46 | }
47 |
48 | return Object.assign({}, nextConfig, {
49 | webpack(config, options) {
+ v
50 + config.resolve.alias['next-intl/config'] = require.resolve(i18nPath);
+ ^
51 |
52 | if (typeof nextConfig.webpack === 'function') {
53 | return nextConfig.webpack(config, options);
54 | }
- *0* arguments[0]
⚠️ function calls are not analysed yet
- *1* i18nPath
⚠️ circular variable reference
- *2* ???*3*((...) => fs["existsSync"](cur))
⚠️ unknown callee
- *3* [???, ???, ???, ???, ???, ???, ???, ???]["find"]
⚠️ non-num constant property on array
node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-intl/plugin.js:8:15 lint TP1006 path.resolve((???*0* | ???*1* | ???*2*)) is very dynamic
4 | const path = require('path');
5 |
6 | function initPlugin(i18nPath, nextConfig) {
7 | if (i18nPath) {
+ v
8 + i18nPath = path.resolve(i18nPath);
+ ^
9 |
10 | if (!fs.existsSync(i18nPath)) {
11 | throw new Error(
12 | `Could not find i18n config at ${i18nPath}, please provide a valid path.`
- *0* arguments[0]
⚠️ function calls are not analysed yet
- *1* i18nPath
⚠️ circular variable reference
- *2* ???*3*((...) => fs["existsSync"](cur))
⚠️ unknown callee
- *3* [???, ???, ???, ???, ???, ???, ???, ???]["find"]
⚠️ non-num constant property on array
event - 2 requests (GET /, ...) 553ms
hey any update on this issue? I'm having the same errors
error - [resolve] node_modules/.pnpm/[email protected]/node_modules/opener/lib/opener.js
node_modules/.pnpm/[email protected]/node_modules/opener/lib/opener.js:65:12 Error resolving commonjs request
61 | });
62 | args = ["/c", "start", "\"\""].concat(args);
63 | }
64 |
+ v-----------------------------------------------------v
65 + return childProcess.execFile(command, args, options, callback);
+ ^-----------------------------------------------------^
66 | };
67 |
unable to resolve dynamic or dynamic or dynamic
warning -
[parse]
node_modules/.pnpm/[email protected]/node_modules/gzip-size/index.js
node_modules/.pnpm/[email protected]/node_modules/gzip-size/index.js:49:17 lint TP1004 fs.createReadStream(???*0*) is very dynamic
45 | };
46 |
47 | module.exports.file = (path, options) => {
48 | return new Promise((resolve, reject) => {
+ v
49 + const stream = fs.createReadStream(path);
+ ^
50 | stream.on('error', reject);
51 |
52 | const gzipStream = stream.pipe(module.exports.stream(options));
53 | gzipStream.on('error', reject);
- *0* path
⚠️ pattern without value
node_modules/.pnpm/[email protected]/node_modules/gzip-size/index.js:58:65 lint TP1004 fs.readFileSync(???*0*) is very dynamic
54 | gzipStream.on('gzip-size', resolve);
55 | });
56 | };
57 |
+ v
58 + module.exports.fileSync = (path, options) => module.exports.sync(fs.readFileSync(path), options);
+ ^
59 |
- *0* path
⚠️ pattern without value
node_modules/.pnpm/[email protected]/node_modules/opener/lib/opener.js
node_modules/.pnpm/[email protected]/node_modules/opener/lib/opener.js:65:11 lint TP1005 child_process.execFile(
61 | });
62 | args = ["/c", "start", "\"\""].concat(args);
63 | }
64 |
+ v
65 + return childProcess.execFile(command, args, options, callback);
+ ^
66 | };
67 |
(???*0* | "cmd.exe" | "open" | "xdg-open" | ???*1* | FreeVar(undefined) | ???*3*),
(???*4* | [???*5*] | ???*6* | ???*9*),
(???*11* | {}),
(???*12* | {})
) is very dynamic
- *0* command
⚠️ pattern without value
- *1* ???*2*["command"]
⚠️ unknown object
- *2* arguments[1]
⚠️ function calls are not analysed yet
- *3* unknown mutation
- *4* arguments[0]
⚠️ function calls are not analysed yet
- *5* args
⚠️ circular variable reference
- *6* ???*7*(???*8*)
⚠️ unknown callee
- *7* [(??? | FreeVar(undefined) | ???)]["concat"]
⚠️ non-num constant property on array
- *8* args
⚠️ circular variable reference
- *9* ???*10*["map"](*anonymous function 2149*)
⚠️ unknown callee object
- *10* args
⚠️ circular variable reference
- *11* arguments[1]
⚠️ function calls are not analysed yet
- *12* arguments[2]
⚠️ function calls are not analysed yet
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js:43:29 lint TP1004 fs.existsSync((???*0* | ???*1*)) is very dynamic
39 | let i=0, arr=toAssume(uri, extns);
40 | let abs, stats, name, headers;
41 | for (; i < arr.length; i++) {
42 | abs = normalize(join(dir, name=arr[i]));
+ v
43 + if (abs.startsWith(dir) && fs.existsSync(abs)) {
+ ^
44 | stats = fs.statSync(abs);
45 | if (stats.isDirectory()) continue;
46 | headers = toHeaders(name, stats, isEtag);
47 | headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
- *0* abs
⚠️ pattern without value
- *1* ???*2*(join(dir, ???*4*))
⚠️ unknown callee
- *2* path*3*["normalize"]
⚠️ unsupported property on Node.js path module
- *3* path: The Node.js path module: https://nodejs.org/api/path.html
- *4* unsupported expression
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js:44:11 lint TP1004 fs.statSync((???*0* | ???*1*)) is very dynamic
40 | let abs, stats, name, headers;
41 | for (; i < arr.length; i++) {
42 | abs = normalize(join(dir, name=arr[i]));
43 | if (abs.startsWith(dir) && fs.existsSync(abs)) {
+ v
44 + stats = fs.statSync(abs);
+ ^
45 | if (stats.isDirectory()) continue;
46 | headers = toHeaders(name, stats, isEtag);
47 | headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
48 | return { abs, stats, headers };
- *0* abs
⚠️ pattern without value
- *1* ???*2*(join(dir, ???*4*))
⚠️ unknown callee
- *2* path*3*["normalize"]
⚠️ unsupported property on Node.js path module
- *3* path: The Node.js path module: https://nodejs.org/api/path.html
- *4* unsupported expression
node_modules/.pnpm/[email protected]/node_modules/sirv/build.js:88:1 lint TP1004 fs.createReadStream(???*0*, {}) is very dynamic
84 | headers['Accept-Ranges'] = 'bytes';
85 | }
86 |
87 | res.writeHead(code, headers);
+ v
88 + fs.createReadStream(file, opts).pipe(res);
+ ^
89 | }
90 |
91 | const ENCODING = {
92 | '.br': 'br',
- *0* arguments[2]
⚠️ function calls are not analysed yet
node_modules/.pnpm/[email protected]/node_modules/webpack-bundle-analyzer/lib/analyzer.js
node_modules/.pnpm/[email protected]/node_modules/webpack-bundle-analyzer/lib/analyzer.js:179:20 lint TP1004 fs.readFileSync(???*0*, "utf8") is very dynamic
175 | });
176 | }
177 |
178 | function readStatsFromFile(filename) {
+ v
179 + return JSON.parse(fs.readFileSync(filename, 'utf8'));
+ ^
180 | }
181 |
182 | function getChildAssetBundles(bundleStats, assetName) {
183 | return (bundleStats.children || []).find(c => _(c.assetsByChunkName).values().flatten().includes(assetName));
- *0* arguments[0]
⚠️ function calls are not analysed yet
node_modules/.pnpm/[email protected]/node_modules/webpack-bundle-analyzer/lib/parseUtils.js
node_modules/.pnpm/[email protected]/node_modules/webpack-bundle-analyzer/lib/parseUtils.js:16:18 lint TP1004 fs.readFileSync(???*0*, "utf8") is very dynamic
12 | parseBundle
13 | };
14 |
15 | function parseBundle(bundlePath) {
+ v
16 + const content = fs.readFileSync(bundlePath, 'utf8');
+ ^
17 | const ast = acorn.parse(content, {
18 | sourceType: 'script',
19 | // I believe in a bright future of ECMAScript!
20 | // Actually, it's set to `2050` to support the latest ECMAScript version that currently exists.
- *0* arguments[0]
⚠️ function calls are not analysed yet
[resolve]
node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js
node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js:105:22 Error resolving commonjs request
101 | return buf;
102 | }
103 |
104 | try {
+ v-------------------v
105 + const bufferUtil = require('bufferutil');
+ ^-------------------^
106 | const bu = bufferUtil.BufferUtil || bufferUtil;
107 |
108 | module.exports = {
109 | concat,
unable to resolve module "bufferutil"
node_modules/.pnpm/[email protected]/node_modules/ws/lib/validation.js
node_modules/.pnpm/[email protected]/node_modules/ws/lib/validation.js:86:21 Error resolving commonjs request
82 | return true;
83 | }
84 |
85 | try {
+ v-----------------------v
86 + let isValidUTF8 = require('utf-8-validate');
+ ^-----------------------^
87 |
88 | /* istanbul ignore if */
89 | if (typeof isValidUTF8 === 'object') {
90 | isValidUTF8 = isValidUTF8.Validation.isValidUTF8; // utf-8-validate@<3.0.0
unable to resolve module "utf-8-validate"
node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js
node_modules/.pnpm/[email protected]/node_modules/ws/lib/buffer-util.js:117:24 Error resolving commonjs request
113 |
114 | /* istanbul ignore else */
115 | if (!process.env.WS_NO_BUFFER_UTIL) {
116 | try {
+ v-------------------v
117 + const bufferUtil = require('bufferutil');
+ ^-------------------^
118 |
119 | module.exports.mask = function (source, mask, output, offset, length) {
120 | if (length < 48) _mask(source, mask, output, offset, length);
I get similar error info:
next-fineai:dev: - error Error: Cannot access .then on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.
next-fineai:dev: at Object.get (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/build/webpack/loaders/next-flight-loader/module-proxy.js:51:15) [/Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_bd4ac8._.js:11260:15]
next-fineai:dev: at async createComponentTree (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/app-render/app-render.js:606:29) [/Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:39084:29]
next-fineai:dev: [at async /Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:39012:76]
next-fineai:dev: at async Promise.all (index 1)
next-fineai:dev: at async createComponentTree (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/app-render/app-render.js:485:38) [/Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:38979:38]
next-fineai:dev: [at async /Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:39012:76]
next-fineai:dev: at async Promise.all (index 0)
next-fineai:dev: at async createComponentTree (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/app-render/app-render.js:485:38) [/Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:38979:38]
next-fineai:dev: [at async /Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:39247:58]
next-fineai:dev: - error Error: Cannot access .then on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.
next-fineai:dev: at Object.get (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/build/webpack/loaders/next-flight-loader/module-proxy.js:51:15) [/Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_bd4ac8._.js:11260:15]
next-fineai:dev: at async createComponentTree (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/app-render/app-render.js:606:29) [/Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:39084:29]
next-fineai:dev: [at async /Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:39012:76]
next-fineai:dev: at async Promise.all (index 1)
next-fineai:dev: at async createComponentTree (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/app-render/app-render.js:485:38) [/Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:38979:38]
next-fineai:dev: [at async /Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:39012:76]
next-fineai:dev: at async Promise.all (index 0)
next-fineai:dev: at async createComponentTree (node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/app-render/app-render.js:485:38) [/Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:38979:38]
next-fineai:dev: [at async /Users/tangye/Workspace/next-fineai/apps/next-fineai/.next/server/app/edge-pages/chunks/ssr/08b5e__pnpm_29e1e0._.js:39247:58]
next-fineai:dev: digest: "2057607017"
next-fineai:dev: error - [resolve] node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/nanoid/index.cjs
next-fineai:dev: node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/nanoid/index.cjs:1:45 Error resolving commonjs request
next-fineai:dev: + v---------------v
next-fineai:dev: 1 + (()=>{var e={113:e=>{"use strict";e.exports=require("crypto")},660:(e,r,t)=>{let l=t(113);let{urlAlphabet:a}=t(591);const n=128;let _,u;let fillPool=e=>{if(!_||...ndefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(660);module.exports=t})();
next-fineai:dev: + ^---------------^
next-fineai:dev:
next-fineai:dev: unable to resolve module "crypto"
next-fineai:dev:
next-fineai:dev: warning - [parse]
next-fineai:dev: node_modules/.pnpm/[email protected]/node_modules/postcss/lib/input.js
next-fineai:dev: node_modules/.pnpm/[email protected]/node_modules/postcss/lib/input.js:44:20 lint TP1006 path.resolve(???*0*) is very dynamic
next-fineai:dev: 40 | isAbsolute(opts.from)
next-fineai:dev: 41 | ) {
next-fineai:dev: 42 | this.file = opts.from
next-fineai:dev: 43 | } else {
next-fineai:dev: + v
next-fineai:dev: 44 + this.file = resolve(opts.from)
next-fineai:dev: + ^
next-fineai:dev: 45 | }
next-fineai:dev: 46 | }
next-fineai:dev: 47 |
next-fineai:dev: 48 | if (pathAvailable && sourceMapAvailable) {
next-fineai:dev:
next-fineai:dev: - *0* ???*1*["from"]
next-fineai:dev: ⚠️ unknown object
next-fineai:dev: - *1* opts
next-fineai:dev: ⚠️ pattern without value
next-fineai:dev:
next-fineai:dev: node_modules/.pnpm/[email protected]/node_modules/postcss/lib/previous-map.js
next-fineai:dev: node_modules/.pnpm/[email protected]/node_modules/postcss/lib/previous-map.js:88:8 lint TP1004 fs.existsSync(???*0*) is very dynamic
next-fineai:dev: 84 | }
next-fineai:dev: 85 |
next-fineai:dev: 86 | loadFile(path) {
next-fineai:dev: 87 | this.root = dirname(path)
next-fineai:dev: + v
next-fineai:dev: 88 + if (existsSync(path)) {
next-fineai:dev: + ^
next-fineai:dev: 89 | this.mapFile = path
next-fineai:dev: 90 | return readFileSync(path, 'utf-8').toString().trim()
next-fineai:dev: 91 | }
next-fineai:dev: 92 | }
next-fineai:dev:
next-fineai:dev: - *0* arguments[0]
next-fineai:dev: ⚠️ function calls are not analysed yet
next-fineai:dev:
next-fineai:dev: node_modules/.pnpm/[email protected]/node_modules/postcss/lib/previous-map.js:90:13 lint TP1004 fs.readFileSync(???*0*, "utf-8") is very dynamic
next-fineai:dev: 86 | loadFile(path) {
next-fineai:dev: 87 | this.root = dirname(path)
next-fineai:dev: 88 | if (existsSync(path)) {
next-fineai:dev: 89 | this.mapFile = path
next-fineai:dev: + v
next-fineai:dev: 90 + return readFileSync(path, 'utf-8').toString().trim()
next-fineai:dev: + ^
next-fineai:dev: 91 | }
next-fineai:dev: 92 | }
next-fineai:dev: 93 |
next-fineai:dev: 94 | loadMap(file, prev) {
next-fineai:dev:
next-fineai:dev: - *0* arguments[0]
next-fineai:dev: ⚠️ function calls are not analysed yet
next-fineai:dev:
Same here :
error - [resolve] [project]/node_modules/node-gyp-build/node-gyp-build.js /node_modules/node-gyp-build/node-gyp-build.js:22:10 Error resolving commonjs request
18 |
19 | module.exports = load
20 |
21 | function load (dir) {
| v-------------------------------
22 + return runtimeRequire(load.resolve(dir))
23 + }
+-
24 |
25 | load.resolve = load.path = function (dir) {
26 | dir = path.resolve(dir || '.')
27 |
unable to resolve dynamic
| It was not possible to find the requested file.
| Parsed request as written in source code: dynamic
| Path where resolving has started: [project]/node_modules/node-gyp-build/node-gyp-build.js
| Type of request: commonjs request
| Import map: No import map entry
|
Also getting this on the latest version 13.4.13
:
error - [resolve] [project]/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js /node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js:540:22 Error resolving commonjs request
536 | + "});"
537 | + (data ? "req.write('" + JSON.stringify(data).slice(1,-1).replace(/'/g, "\\'") + "');":"")
538 | + "req.end();";
539 | // Start the other Node Process, executing this string
+ v----------------------------------------v
540 + var syncProc = spawn(process.argv[0], ["-e", execString]);
+ ^----------------------------------------^
541 | var statusText;
542 | while(fs.existsSync(syncFile)) {
543 | // Wait while the sync file is empty
544 | }
unable to resolve module "-e" or dynamic
| It was not possible to find the requested file.
| Parsed request as written in source code: module "-e" or dynamic
| Path where resolving has started: [project]/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js
| Type of request: commonjs request
| Import map: No import map entry
|
@ringblaze/web:dev: X ModuleBuildError: error - node_modules/.pnpm/[email protected]/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:503:22 Error resolving commonjs request
@ringblaze/web:dev:
@ringblaze/web:dev: 501 | + "req.end();";
@ringblaze/web:dev: 502 | // Start the other Node Process, executing this string
@ringblaze/web:dev: > 503 | var syncProc = spawn(process.argv[0], ["-e", execString]);
@ringblaze/web:dev: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ringblaze/web:dev: 504 | while(fs.existsSync(syncFile)) {
@ringblaze/web:dev: 505 | // Wait while the sync file is empty
@ringblaze/web:dev: 506 | }
@ringblaze/web:dev: unable to resolve module "-e" or dynamic
@ringblaze/web:dev: It was not possible to find the requested file.
Same for us
link @timneutkens from your comments there, i tried using turbopack but this issue is blocking me to run next dev --turbo. I hope and trust you guys will resolve this. but this issue stands for over an year here. this is the exact error i am now seeing.
Error resolving EcmaScript Modules request unable to resolve module "fs" It was not possible to find the requested file. Parsed request as written in source code: module "fs" Path where resolving has started: [project]/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js Type of request: EcmaScript Modules request Import map: No import map entry
@adarsh-drishya that error is quite different from what was initially reported in this issue. Can you open another issue with a reproduction?
@codart1 that looks very similar to what is fixed in https://github.com/vercel/turbo/pull/6118 which will be landed as part of this PR on Next.js: https://github.com/vercel/next.js/pull/56756
hi @timneutkens , i have created a reproduction for your help here in this ticket https://github.com/vercel/next.js/issues/56844 I have verified that the latest canary does not fix the issue. Please clone the reproduction and see for yourself. Thanks
@ringblaze/web:dev: X ModuleBuildError: error - node_modules/.pnpm/[email protected]/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:503:22 Error resolving commonjs request @ringblaze/web:dev: @ringblaze/web:dev: 501 | + "req.end();"; @ringblaze/web:dev: 502 | // Start the other Node Process, executing this string @ringblaze/web:dev: > 503 | var syncProc = spawn(process.argv[0], ["-e", execString]); @ringblaze/web:dev: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @ringblaze/web:dev: 504 | while(fs.existsSync(syncFile)) { @ringblaze/web:dev: 505 | // Wait while the sync file is empty @ringblaze/web:dev: 506 | } @ringblaze/web:dev: unable to resolve module "-e" or dynamic @ringblaze/web:dev: It was not possible to find the requested file.
Same for us
Try with Node.js 20
. It fixed the issue in my case
Hi all on NODE: 20.0.0 NPM: 9.6.4 TURBO: 1.10.15 NEXTJS: 14.0.0 ARCH: arm64 PLATEFORM: MAC M2 silicon
i having a dynamic require not supported
that throw on the front end side with turbo 1.10.15 with next 14.0.0
https://github.com/XPRNetwork/proton-web-sdk
Unhandled Runtime Error
Error: Dynamic require of "abortcontroller-polyfill/dist/polyfill-patch-fetch" is not supported
Call Stack
eval
../../node_modules/@proton/js/dist/index.mjs (7:0)
eval
../../node_modules/@proton/js/dist/index.mjs (522:0)
(app-pages-browser)/../../node_modules/@proton/js/dist/index.mjs
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/app/layout.js (1186:1)
options.factory
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (716:31)
__webpack_require__
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (37:33)
fn
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (371:21)
eval
webpack-internal:///(app-pages-browser)/../../node_modules/@proton/link/lib/proton-link.m.js (110:68)
(app-pages-browser)/../../node_modules/@proton/link/lib/proton-link.m.js
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/app/layout.js (352:1)
options.factory
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (716:31)
__webpack_require__
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (37:33)
fn
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (371:21)
eval
webpack-internal:///(app-pages-browser)/../../node_modules/@proton/browser-transport/lib/proton-browser-transport.m.js (5:70)
(app-pages-browser)/../../node_modules/@proton/browser-transport/lib/proton-browser-transport.m.js
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/app/layout.js (331:1)
options.factory
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (716:31)
__webpack_require__
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (37:33)
fn
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (371:21)
eval
webpack-internal:///(app-pages-browser)/../../node_modules/@proton/web-sdk/dist/index.js (5:83)
(app-pages-browser)/../../node_modules/@proton/web-sdk/dist/index.js
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/app/layout.js (1197:1)
options.factory
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (716:31)
__webpack_require__
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (37:33)
fn
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (371:21)
eval
webpack-internal:///(app-pages-browser)/../../packages/store/src/models/auth.ts (5:73)
(app-pages-browser)/../../packages/store/src/models/auth.ts
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/app/layout.js (91:1)
options.factory
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (716:31)
__webpack_require__
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (37:33)
fn
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (371:21)
eval
webpack-internal:///(app-pages-browser)/../../packages/store/src/models/index.ts (7:63)
(app-pages-browser)/../../packages/store/src/models/index.ts
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/app/layout.js (102:1)
options.factory
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (716:31)
__webpack_require__
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (37:33)
fn
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (371:21)
eval
webpack-internal:///(app-pages-browser)/../../packages/store/src/store.ts (6:65)
(app-pages-browser)/../../packages/store/src/store.ts
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/app/layout.js (124:1)
options.factory
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (716:31)
__webpack_require__
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (37:33)
fn
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (371:21)
eval
webpack-internal:///(app-pages-browser)/../../packages/store/src/index.ts (35:64)
(app-pages-browser)/../../packages/store/src/index.ts
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/app/layout.js (80:1)
options.factory
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (716:31)
__webpack_require__
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (37:33)
fn
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (371:21)
eval
webpack-internal:///(app-pages-browser)/./app/layout.tsx (8:63)
(app-pages-browser)/./app/layout.tsx
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/app/layout.js (58:1)
options.factory
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (716:31)
__webpack_require__
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (37:33)
fn
file:///Users/remychauveau/Documents/WORKSPACE/Snipverse-project/apps/web/.next/static/chunks/webpack.js (371:21)
requireModule
node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js (156:22)
initializeModuleChunk
node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js (1357:0)
readChunk
node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js (1167:0)
mountLazyComponent
node_modules/next/dist/compiled/react-dom/cjs/react-dom.development.js (16540:0)
I tested on a next 14.0.0 (no turbo repo config) it's working with no issue at all. Is it could be related to this issue ?
yarn dev --turbo is also failing for me on next 14
yarn dev --turbo is also failing for me on next 14
For me the issue was that I was using node link
, you have to install the module in the project with yarn add
for example. But that was my case.
I also have the same problem on next 14
In the new learn of nextjs, if you dev start command with --turbo, calling await fetchRevenue in the example will report the same error. https://nextjs.org/learn/dashboard-app/fetching-data
nextjs version 14
same for me on next 14
After 13 monthes of reporting the issue. It still hasn't been resolved!
Honestly Vercel has become a joke -- I've used Next.JS since the very beginning and I've seen a huge downgrade in performance and community support in addressing these types of issues.
Hey all, we've been making a lot of progress on these types of issues over the last 3 weeks. I just ran the /learn application and it now compiles correctly whereas it errored on 14.0.3. Please give npm install next@canary
try. Based on the comments in this issue everyone was running into different issues. If you're still running into issues please open a new issue with a reproduction so that we can investigate and fix the particular case that you're running into.
Thanks!
Nice, I'm no longer seeing this error in 14.0.4-canary.28!
Still happening …..
Solved in canary for me too, especially supabase and supabase ssr work now.