Build error on vercel and local both Next 13 #76508
Replies: 1 comment 1 reply
-
It looks like you are trying to load packages/modules that depend on Node.js API's, on an Edge environment, which doesn't support all of those APIs. Typically, this happen when one uses these packages on Middleware. In the future Middleware will support Node.js, but in Next 13, it doesn't. You'll need to either figure out, if you should silence the errors, in case you know you can safely do so, by aliasing to the packages to false, or find alternative packages that support a non-Node.js environment. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
npm run build
⚠ Invalid next.config.js options detected:
⚠ Expected boolean, received object at "experimental.serverActions"
⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config
Failed to compile.
./node_modules/@google-cloud/firestore/build/src/index.js:42:22
Module not found: Can't resolve 'querystring'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/firebase-admin/lib/firestore/index.js
./node_modules/firebase-admin/lib/esm/firestore/index.js
./src/lib/firebase/admin.ts
./src/app/api/domain/route.ts
./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2Fdomain%2Froute.ts&page=%2Fapi%2Fdomain%2Froute&appDirLoader=bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBpJTJGZG9tYWluJTJGcm91dGUmcGFnZT0lMkZhcGklMkZkb21haW4lMkZyb3V0ZSZwYWdlUGF0aD1wcml2YXRlLW5leHQtYXBwLWRpciUyRmFwaSUyRmRvbWFpbiUyRnJvdXRlLnRzJmFwcERpcj1FJTNBJTVDVmVyY2VsJTVDVW1lciUyMEdpbGxhbmklMjAxJTVDY29udHJhLWNsb25lLW1haW4lNUNzcmMlNUNhcHAmYXBwUJTJGZG9tYWluJTJGcm91dGUmcGFnZUV4dGVuc2lvbnM9dHN4JnBhZ2VFeHRlbnNpb25zPXRzJnBhZ2VFeHRlbnNpb25zPWpzeCZwYWdlRXh0ZW5zaW9ucz1qcyZiYXNlUGF0aD0mYXNzZXRQcmVmaXg9Jm5leHRDb25maWdPdXRwdXQ9JnByZWZlcnJlZFJlZ2lvbj0mbWlkZGxld2FyZUNvbmZpZz1lMzAlM0Qh&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
./node_modules/@google-cloud/firestore/build/src/util.js:19:17
Module not found: Can't resolve 'crypto'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/@google-cloud/firestore/build/src/path.js
./node_modules/firebase-admin/lib/firestore/index.js
./node_modules/firebase-admin/lib/esm/firestore/index.js
./src/lib/firebase/admin.ts
./src/app/api/domain/route.ts
./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2Fdomain%2Froute.ts&page=%2Fapi%2Fdomain%2Froute&appDirLoader=bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBpJTJGZG9tYWluJTJGcm91dGUmcGFnZT0lMkZhcGklMMkZyb3V0ZSZwYWdlUGF0aD1wcml2YXRlLW5leHQtYXBwLWRpciUyRmFwaSUyRmRvbWFpbiUyRnJvdXRlLnRzJmFwcERpcj1FJTNBJTVDVmVyY2VsJTVDVW1lciUyMEdpbGxhbmklMjAxJTVDY29udHJhLWNsb25lLW1haW4lNUNzcmMlNUNhcHAmYXBwUGF0aHM9JTJGYXBpJTJGZG9tYWluJTJGcm91dGUmcGFnZUV4dGVuc2lvbnM9dHN4JnBhZ2VFeHRlbnNpb25zPXRzJnBhZ2VFeHRlbnNpb25zPWpzeCZwYWdlRXh0ZW5zaW9ucz1qcyZiYXNlUGF0aD0mYXNzZXRQcmVmaXg9Jm5leHRDb25maWdPdXRwdXQ9JnByZWZlcnJlZFJlZ2lvbj0mbWlkZGxld2FyZUNvbmZpZz1lMzAlM0Qh&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
./node_modules/gaxios/build/src/gaxios.js:20:16
Module not found: Can't resolve 'https'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/gaxios/build/src/index.js
./node_modules/google-auth-library/build/src/transporters.js
./node_modules/google-auth-library/build/src/index.js
./node_modules/google-gax/build/src/fallback.js
./node_modules/@google-cloud/firestore/build/src/util.js
./node_modules/@google-cloud/firestore/build/src/path.js
./node_modules/firebase-admin/lib/firestore/index.js
./node_modules/firebase-admin/lib/esm/firestore/index.js
./src/lib/firebase/admin.ts
./src/app/api/domain/route.ts
./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2Fdomain%2Froute.ts&page=%2Fapi%2Fdomain%2Froute&appDirLoader=bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBpJTJGZG9tYWluJTJGcm91dGUmcBJTVDVmVyY2VsJTVDVW1lciUyMEdpbGxhbmklMjAxJTVDY29udHJhLWNsb25lLW1haW4lNUNzcmMlNUNhcHAmYXBwUGF0aHM9JTJGYXBpJTJGZG9tYWluJTJGcm91dGUmcGFnZUV4dGVuc2lvbnM9dHN4JnBhZ2VFeHRlbnNpb25zPXRzJnBhZ2VFeHRlbnNpb25zPWpzeCZwYWdlRXh0ZW5zaW9ucz1qcyZiYXNlUGF0aD0mYXNzZXRQcmVmaXg9Jm5leHRDb25maWdPdXRwdXQ9JnByZWZlcnJlZFJlZ2lvbj0mbWlkZGxld2FyZUNvbmZpZz1lMzAlM0Qh&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
./node_modules/gaxios/build/src/gaxios.js:22:38
Module not found: Can't resolve 'querystring'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/gaxios/build/src/index.js
./node_modules/google-auth-library/build/src/transporters.js
./node_modules/google-auth-library/build/src/index.js
./node_modules/google-gax/build/src/fallback.js
./node_modules/@google-cloud/firestore/build/src/util.js
./node_modules/@google-cloud/firestore/build/src/path.js
./node_modules/firebase-admin/lib/firestore/index.js
./node_modules/firebase-admin/lib/esm/firestore/index.js
./src/lib/firebase/admin.ts
./src/app/api/domain/route.ts
./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2Fdomain%2Froute.ts&page=%2Fapi%2Fdomain%2Froute&appDirLoader=bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBpJTJGZG9tYWluJTJGcm91dGUmcGFnZT0lMkZhcGklMkZkb21haW4lMkZyb3V0ZSZwYWdlUGF0aD1wcml2YXRlLW5leHQtYXBwLWRpciUyRmFwaSUyRmRvbWFpbiUyRnJvdXRlLnRzJmFwcERpcj1FJTNBJTVDVmVyY2VsJTVDVW1lciUyMEdpbGxhbmklMjAxJTVDY29udHJhLWNsb25lLW1haW4lNUNzcF0aHM9JTJGYXBpJTJGZG9tYWluJTJGcm91dGUmcGFnZUV4dGVuc2lvbnM9dHN4JnBhZ2VFeHRlbnNpb25zPXRzJnBhZ2VFeHRlbnNpb25zPWpzeCZwYWdlRXh0ZW5zaW9ucz1qcyZiYXNlUGF0aD0mYXNzZXRQcmVmaXg9Jm5leHRDb25maWdPdXRwdXQ9JnByZWZlcnJlZFJlZ2lvbj0mbWlkZGxld2FyZUNvbmZpZz1lMzAlM0Qh&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
./node_modules/gcp-metadata/build/src/gcp-residency.js:19:13
Module not found: Can't resolve 'fs'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/gcp-metadata/build/src/index.js
./node_modules/google-auth-library/build/src/auth/computeclient.js
./node_modules/google-auth-library/build/src/index.js
./node_modules/google-gax/build/src/fallback.js
./node_modules/@google-cloud/firestore/build/src/util.js
./node_modules/@google-cloud/firestore/build/src/path.js
./node_modules/firebase-admin/lib/firestore/index.js
./node_modules/firebase-admin/lib/esm/firestore/index.js
./src/lib/firebase/admin.ts
./src/app/api/domain/route.ts
./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2Fdomain%2Froute.ts&page=%2Fapi%2Fdomain%2Froute&appDirLoader=bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBpJTJGZG9tYWluJTJGcm91dGUGklMkZkb21haW4lMkZyb3V0ZSZwYWdlUGF0aD1wcml2YXRlLW5leHQtYXBwLWRpciUyRmFwaSUyRmRvbWFpbiUyRnJvdXRlLnRzJmFwcERpcj1FJTNBJTVDVmVyY2VsJTVDVW1lciUyMEdpbGxhbmklMjAxJTVDY29udHJhLWNsb25lLW1haW4lNUNzcmMlNUNhcHAmYXB9JTJGYXBpJTJGZG9tYWluJTJGcm91dGUmcGFnZUV4dGVuc2lvbnM9dHN4JnBhZ2VFeHRlbnNpb25zPXRzJnBhZ2VFeHRlbnNpb25zPWpzeCZwYWdlRXh0ZW5zaW9ucz1qcyZiYXNlUGF0aD0mYXNzZXRQcmVmaXg9Jm5leHRDb25maWdPdXRwdXQ9JnByZWZlcnJlZFJlZ2lvbj0mbWlkZGxld2FyZUNvbmZpZz1lMzAlM0Qh&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions