You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101
Binaries:
Node: 16.13.0
npm: 8.19.2
Yarn: 1.22.15
pnpm: 6.11.0
Relevant packages:
next: 13.0.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
Which example does this report relate to?
with-mongodb-app
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I created next.config.js and set experimental: { appDir: true }, then created app folder with layout.tsx and page.tsx and renamed index.tsx in pages folder to avoid conflict. Here is what inside the page:
The getData() manages to load the data, but it always produces long warning in console:
event - compiled client and server successfully in 364 ms (199 modules)
wait - compiling /page (client and server)...
warn - ./node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js
Module not found: Can't resolve 'aws-crt' in '/Users/polt/tmp/with-mongodb-app/node_modules/@aws-sdk/util-user-agent-node/dist-cjs'
./node_modules/mongodb/lib/bson.js
Module not found: Can't resolve 'bson-ext' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/deps.js
Module not found: Can't resolve 'kerberos' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/deps.js
Module not found: Can't resolve '@mongodb-js/zstd' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/deps.js
Module not found: Can't resolve 'snappy' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/deps.js
Module not found: Can't resolve 'snappy/package.json' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/deps.js
Module not found: Can't resolve 'aws4' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/utils.js
Critical dependency: the request of a dependency is an expression
./node_modules/mongodb/lib/utils.js
Module not found: Can't resolve 'mongodb-client-encryption' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
wait - compiling...
warn - ./node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-available.js
Module not found: Can't resolve 'aws-crt' in '/Users/polt/tmp/with-mongodb-app/node_modules/@aws-sdk/util-user-agent-node/dist-cjs'
./node_modules/mongodb/lib/bson.js
Module not found: Can't resolve 'bson-ext' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/deps.js
Module not found: Can't resolve 'kerberos' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/deps.js
Module not found: Can't resolve '@mongodb-js/zstd' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/deps.js
Module not found: Can't resolve 'snappy' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/deps.js
Module not found: Can't resolve 'snappy/package.json' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/deps.js
Module not found: Can't resolve 'aws4' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
./node_modules/mongodb/lib/utils.js
Critical dependency: the request of a dependency is an expression
./node_modules/mongodb/lib/utils.js
Module not found: Can't resolve 'mongodb-client-encryption' in '/Users/polt/tmp/with-mongodb-app/node_modules/mongodb/lib'
^C%
Note: I can build it locally, however when tried to deploy to vercel it failed with near identical error/warning.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101
Binaries:
Node: 16.13.0
npm: 8.19.2
Yarn: 1.22.15
pnpm: 6.11.0
Relevant packages:
next: 13.0.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
Which example does this report relate to?
with-mongodb-app
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I created next.config.js and set
experimental: { appDir: true }
, then createdapp
folder withlayout.tsx
andpage.tsx
and renamedindex.tsx
inpages
folder to avoid conflict. Here is what inside the page:The
getData()
manages to load the data, but it always produces long warning in console:Note: I can build it locally, however when tried to deploy to vercel it failed with near identical error/warning.
Expected Behavior
Should run without error/warning.
To Reproduce
npx create-next-app --example with-mongodb with-mongodb-app
pages/index.tsx
topages/_index.tsx
app/layout.tsx
andapp/page.tsx
npm run dev
npm run build
The text was updated successfully, but these errors were encountered: