Im having an issue that I first saw after the release of NextJS 12 and im still seeing now with NextJS 12.0.8. It's completely stopping me from upgrading from version 11.
Essentially my application will build fine, no errors, and the server will start, but the second I make the first request to it, it trips over and I get the following highly unhelpful error
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.__webpack_require__.f.require (/app/.next/server/webpack-runtime.js:143:28)
at /app/.next/server/webpack-runtime.js:70:40
/app/.next/server/chunks/6859.js:135
/***/ }),
^
SyntaxError: Unexpected token ')'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.__webpack_require__.f.require (/app/.next/server/webpack-runtime.js:143:28)
at /app/.next/server/webpack-runtime.js:70:40
The problem seems to be running on Alpine linux as I can perform a production build locally, then run it with no issues However after building my production docker container and deploying it, I see a white screen, with this error in the console.
Googling this has come up with nothing, checking the source at that point reveals nothing interesting to me.
My app has been working fine on Next JS 11, but upgrading to 12 blows up. I see nothing in the docs about needing to do anything different with regards to docker or alpine linux.
Can any one help?
So the problem was due to an internal cleaning process we run and a change in the way Next 12 prints the source map declarations.
Basically, the sourcemap definition was on the same line as the closing bracket, whereas it was on a new line previously.
More info here: https://github.com/vercel/next.js/issues/33241#issuecomment-1013580180
Related
I have a pull request in with the nextjs project here:
https://github.com/vercel/next.js/pull/45238
To get it accepted, I need to run pnpm lint-fix on the code.
I am utterly unfamiliar with pnpm and Python, but I got the latter installed correctly and then the former. I ran pnpm install and I then ran pnpm install lint-fix
It all installed. Or at least it appeared to do so.
Then, I try to run pnpm lint-fix and the result is:
PS C:\code\next.js\examples\auth-passage-passwordless> pnpm lint-fix
Error: Module build failed: TypeError: /home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/lib/bin.js: Duplicate declaration "b" (This is an error on an internal node. Probably an internal error.)
at File.buildCodeFrameError (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/lib/transformation/file/file.js:209:12)
at Scope.checkBlockScopedCollisions (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/scope/index.js:303:27)
at Scope.registerBinding (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/scope/index.js:485:16)
at Scope.registerDeclaration (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/scope/index.js:404:14)
at Object.BlockScoped (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/scope/index.js:146:28)
at Object.newFn (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/visitors.js:266:17)
at NodePath._call (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/path/context.js:64:19)
at NodePath.call (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/path/context.js:34:14)
at NodePath.visit (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/path/context.js:99:12)
at TraversalContext.visitQueue (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/context.js:139:18)
at Object. (C:\code\next.js\examples\auth-passage-passwordless\node_modules\lint-fix\dist\bin.js:71:7)
at webpack_require (C:\code\next.js\examples\auth-passage-passwordless\node_modules\lint-fix\dist\bin.js:21:30)
at C:\code\next.js\examples\auth-passage-passwordless\node_modules\lint-fix\dist\bin.js:64:18
at Object. (C:\code\next.js\examples\auth-passage-passwordless\node_modules\lint-fix\dist\bin.js:67:10)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
I have Googled until my fingers bled, but came across nothing of help.
How do I get lint-fix up and running?
It normally works but suddenly it stoped working and im not sure
why. If you can help thanks!
logs
2022-11-24T13:14:56.98176Z Executing user command: next build && next export
2022-11-24T13:14:57.075259Z /opt/buildhome/repo/node_modules/next/dist/build/index.js:344
2022-11-24T13:14:57.075558Z ...pageKeys.app ?? [],
2022-11-24T13:14:57.075709Z ^
2022-11-24T13:14:57.075852Z
2022-11-24T13:14:57.075978Z SyntaxError: Unexpected token '?'
2022-11-24T13:14:57.076087Z at wrapSafe (internal/modules/cjs/loader.js:1054:16)
2022-11-24T13:14:57.076193Z at Module._compile (internal/modules/cjs/loader.js:1102:27)
2022-11-24T13:14:57.0763Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
2022-11-24T13:14:57.076409Z at Module.load (internal/modules/cjs/loader.js:986:32)
2022-11-24T13:14:57.076516Z at Function.Module._load (internal/modules/cjs/loader.js:879:14)
2022-11-24T13:14:57.076621Z at Module.require (internal/modules/cjs/loader.js:1026:19)
2022-11-24T13:14:57.076736Z at require (internal/modules/cjs/helpers.js:72:18)
2022-11-24T13:14:57.076877Z at Object.<anonymous> (/opt/buildhome/repo/node_modules/next/dist/cli/next-build.js:10:37)
2022-11-24T13:14:57.077002Z at Module._compile (internal/modules/cjs/loader.js:1138:30)
2022-11-24T13:14:57.077111Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
2022-11-24T13:14:57.082209Z Failed: build command exited with code: 1
2022-11-24T13:14:57.927713Z Failed: an internal error occurred
It exports the files and deploys to cloud flare
The error you are getting indicates that your Node version does not support the nullish coalescing operator, which is part of Node as of version 14.
From reading the Cloudflare docs I understand that the default Node version is 12, which would match this suspicion.
The solution then would be to update your Cloudflare configuration to use a newer version (14+) of Node (see docs).
It looks like my build is working fine. (And build fine locally).
But I get this error when deploying to Vercel.
08:04:54.329 [4/4] Building fresh packages...
08:04:56.738 success Saved lockfile.
08:04:56.742 Done in 39.69s.
08:04:56.778 Detected Next.js version: 10.0.3
08:04:56.779 Running "yarn run build"
08:04:57.063 yarn run v1.22.10
08:04:57.106 $ next build
08:04:57.789 Browserslist: caniuse-lite is outdated. Please run:
08:04:57.790 npx browserslist#latest --update-db
08:04:57.894 info - Creating an optimized production build...
08:04:57.915 Attention: Next.js now collects completely anonymous telemetry regarding usage.
08:04:57.915 This information is used to shape Next.js' roadmap and prioritize features.
08:04:57.915 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
08:04:57.915 https://nextjs.org/telemetry
08:06:05.124 info - Compiled successfully
08:06:05.125 info - Collecting page data...
08:06:07.309 > Build error occurred
08:06:07.312 TypeError: Cannot read property 'system' of undefined
08:06:07.312 at Object.get (/vercel/workpath0/node_modules/faker/lib/index.js:75:47)
08:06:07.312 at new System (/vercel/workpath0/node_modules/faker/lib/system.js:41:44)
08:06:07.312 at new Faker (/vercel/workpath0/node_modules/faker/lib/index.js:147:17)
08:06:07.312 at Object.<anonymous> (/vercel/workpath0/node_modules/faker/locale/en_US.js:2:13)
08:06:07.312 at Module._compile (internal/modules/cjs/loader.js:1063:30)
08:06:07.312 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
08:06:07.312 at Module.load (internal/modules/cjs/loader.js:928:32)
08:06:07.313 at Function.Module._load (internal/modules/cjs/loader.js:769:14)
08:06:07.317 at Module.require (internal/modules/cjs/loader.js:952:19)
08:06:07.317 at require (internal/modules/cjs/helpers.js:88:18) {
08:06:07.317 type: 'TypeError'
08:06:07.318 }
08:06:07.468 error Command failed with exit code 1.
08:06:07.469 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
08:06:07.486 Error: Command "yarn run build" exited with 1
08:06:10.181 Done with "package.json"
As #juliomalves pointed out. It was faker's fault. It was working fine, then suddenly it wasn't. I ended up just removing it from my packages.
yarn remove faker
And just stripped it out of the project as it was just being used for demo stuff. Now all good.
Hello my atom software is not executing programs . i would love to know how i can solve this problem
::When i execute i am given the following error
[ ^^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:606:28)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Function.Module.runMain (module.js:683:10)
at startup (bootstrap_node.js:196:16)
at bootstrap_node.js:622:3][1]
To execute a program in Atom I would first try downloading and installing the Script package. After installing this package, open your file and go to the packages menu. You'll see the newly installed script. Select this to run your script. See image below.
Do all your lib/*.js files have at the top this line?
'use babel';
I'm trying to port a Meteor application from Heroku to Modulus.io (hopefully will be able to test out sticky sessions and horizontal scaling). I've demeteorized my app using the Modulus.io script, as spelled out in the following articles and repositories.
https://github.com/onmodulus/demeteorizer
http://blog.modulus.io/demeteorizer
After demeteorizing, I zipped and uploaded, and got an empty deploy log and a white screen in the browser. After a bit more research, I deleted the node_modules directory in the resulting demeteorized application, and then zipped and uploaded. That definitely seemed to be the right move, because everything started deploying, and the logs got busy.
Here's the error I'm coming up with though:
Error: `/mnt/data/1/clinical-workqueues/server/node_modules/fibers/bin/linux-x64-v8-3.11/fibers.node` is missing. Try reinstalling `node-fibers`?
at Object.<anonymous> (/mnt/data/1/clinical-workqueues/server/node_modules/fibers/fibers.js:13:8)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/mnt/data/1/clinical-workqueues/server/server.js:3:13)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
Forever detected script exited with code: 1
Forever restarting script for 6 time
Does anybody know how I ought to go about 'reinstalling node-fibers' in the Modulus.io environment, using a demeteorized Meteor app? I'm getting out of my league here, and am not sure how to proceed.
Thanks in advance for any thoughts or suggestions!
I created a blog article that should help out others trying to deploy Meteor apps to Modulus.
http://blog.modulus.io/deploying-meteor-apps-on-modulus
Disclosure: I'm the author of Demeteorizer and co-founder of Modulus.
Solution was to upgrade to Demeteorizer 0.2.1, run a 'meteor add email' to my application, and then add the following dependencies to my package.json file:
"sockjs": "0.3.4",
"websocket": "1.0.7",
"mongodb": "1.2.13",
"mailcomposer": "0.1.15"