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
> Build error occurred
TypeError: Cannot read property 'env' of undefined
at Object.320 (/workspace/nextjs-multilanguage-website/.next/server/pages/404.js:754:62)
at __webpack_require__ (/workspace/nextjs-multilanguage-website/.next/server/webpack-runtime.js:25:42)
at Object.125 (/workspace/nextjs-multilanguage-website/.next/server/pages/404.js:686:74)
at __webpack_require__ (/workspace/nextjs-multilanguage-website/.next/server/webpack-runtime.js:25:42)
at __webpack_exec__ (/workspace/nextjs-multilanguage-website/.next/server/pages/404.js:861:52)
at /workspace/nextjs-multilanguage-website/.next/server/pages/404.js:862:28
at Object.<anonymous> (/workspace/nextjs-multilanguage-website/.next/server/pages/404.js:865:3)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32) {
type: 'TypeError'
}
Looking into .next/server/pages/404 or .next/server/pages/[[...slug]].js we can see that something is messing up the process.env call. Seems like autoprefixer or something. Although I thought that was for CSS only, why is it messing up this simple nodejs code? No idea.
Okay it seems we need to use NEXT_PUBLIC environment variables. Although probably not a good idea to expose this to the browser. Or is it a requirement and doesn't impose any security risk?
Trying to load the access token from an environment variable (as it should be from the beginning instead of hardcoding it), breaks the build.
Build throws the following error:
Looking into
.next/server/pages/404
or.next/server/pages/[[...slug]].js
we can see that something is messing up theprocess.env
call. Seems like autoprefixer or something. Although I thought that was for CSS only, why is it messing up this simple nodejs code? No idea.The text was updated successfully, but these errors were encountered: