Home
Support Forums

Not able to login or reset password for identity for a Next.js blog

So I installed this https://manojnayak.netlify.app

Now when I accept the invite for a user, it won’t pop up the password setup option, so I tried to manually ask for a password reset, I got a reset email but it does work.

Seems like a bug!

Hi @exist2021,

Have you added the code mentioned here to your website:

https://www.netlifycms.org/docs/add-to-your-site/#add-the-netlify-identity-widget

oh, okay, this worked. I could now login into the CMS. Thanks!

But After injecting the code snippet, the site failed to build.

Pasting the deploy log below

12:21:18 PM: Build ready to start
12:21:20 PM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0
12:21:20 PM: build-image tag: v4.3.0
12:21:20 PM: buildbot version: fd60e21d56897195475b3dbb3e1c495894eb873c
12:21:21 PM: Fetching cached dependencies
12:21:21 PM: Starting to download cache of 314.1MB
12:21:23 PM: Finished downloading cache in 2.415964986s
12:21:23 PM: Starting to extract cache
12:21:36 PM: Finished extracting cache in 13.043285368s
12:21:37 PM: Finished fetching cache in 16.009913654s
12:21:37 PM: Starting to prepare the repo for build
12:21:37 PM: Preparing Git Reference pull/2/head
12:21:37 PM: Parsing package.json dependencies
12:21:38 PM: Starting build script
12:21:38 PM: Installing dependencies
12:21:38 PM: Python version set to 2.7
12:21:39 PM: Started restoring cached node version
12:21:42 PM: Finished restoring cached node version
12:21:43 PM: v16.8.0 is already installed.
12:21:43 PM: Now using node v16.8.0 (npm v7.21.0)
12:21:43 PM: Started restoring cached build plugins
12:21:43 PM: Finished restoring cached build plugins
12:21:44 PM: Attempting ruby version 2.7.2, read from environment
12:21:46 PM: Using ruby version 2.7.2
12:21:46 PM: Using PHP version 8.0
12:21:46 PM: Started restoring cached yarn cache
12:21:51 PM: Finished restoring cached yarn cache
12:21:52 PM: No yarn workspaces detected
12:21:52 PM: Started restoring cached node modules
12:21:52 PM: Finished restoring cached node modules
12:21:52 PM: Installing NPM modules using Yarn version 1.22.10
12:21:53 PM: yarn install v1.22.10
12:21:53 PM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
12:21:53 PM: [1/4] Resolving packages…
12:21:53 PM: [2/4] Fetching packages…
12:21:54 PM: info fsevents@2.3.2: The platform β€œlinux” is incompatible with this module.
12:21:54 PM: info β€œfsevents@2.3.2” is an optional dependency and failed compatibility check. Excluding it from installation.
12:21:54 PM: [3/4] Linking dependencies…
12:21:54 PM: warning " > next-mdx-remote@2.1.3" has incorrect peer dependency β€œreact@>=16.13.1 <=17.0.1”.
12:21:54 PM: warning " > next-mdx-remote@2.1.3" has incorrect peer dependency β€œreact-dom@>=16.13.1 <=17.0.1”.
12:21:54 PM: warning " > react-instagram-embed@2.0.0" has incorrect peer dependency β€œreact@^16.0.0 || ^15.0.0 || ~0.14.0”.
12:21:54 PM: warning " > react-instagram-embed@2.0.0" has incorrect peer dependency β€œreact-dom@^16.0.0 || ^15.0.0 || ~0.14.0”.
12:21:54 PM: warning " > react-twitter-embed@3.0.3" has unmet peer dependency β€œprop-types@^15.5.4”.
12:21:54 PM: warning " > react-twitter-embed@3.0.3" has incorrect peer dependency β€œreact@^15.0.0 || ^16.0.0”.
12:21:54 PM: warning " > react-twitter-embed@3.0.3" has incorrect peer dependency β€œreact-dom@^15.0.0 || ^16.0.0”.
12:21:54 PM: warning β€œreact-twitter-embed > enzyme-adapter-react-16@1.15.6” has unmet peer dependency β€œenzyme@^3.0.0”.
12:21:54 PM: warning β€œreact-twitter-embed > enzyme-adapter-react-16@1.15.6” has incorrect peer dependency β€œreact@^16.0.0-0”.
12:21:54 PM: warning β€œreact-twitter-embed > enzyme-adapter-react-16@1.15.6” has incorrect peer dependency β€œreact-dom@^16.0.0-0”.
12:21:54 PM: warning β€œreact-twitter-embed > enzyme-adapter-react-16 > enzyme-adapter-utils@1.14.0” has incorrect peer dependency β€œreact@0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0”.
12:21:54 PM: warning β€œreact-twitter-embed > enzyme-adapter-react-16 > react-test-renderer@16.14.0” has incorrect peer dependency β€œreact@^16.14.0”.
12:21:54 PM: warning β€œreact-twitter-embed > enzyme-adapter-react-16 > enzyme-adapter-utils > airbnb-prop-types@2.16.0” has incorrect peer dependency β€œreact@^0.14 || ^15.0.0 || ^16.0.0-alpha”.
12:21:57 PM: [4/4] Building fresh packages…
12:21:58 PM: success Saved lockfile.
12:21:58 PM: Done in 5.06s.
12:21:58 PM: NPM modules installed using Yarn
12:21:58 PM: Started restoring cached go cache
12:21:58 PM: Finished restoring cached go cache
12:21:58 PM: go version go1.16.5 linux/amd64
12:21:58 PM: go version go1.16.5 linux/amd64
12:21:58 PM: Installing missing commands
12:21:58 PM: Verify run directory
12:22:00 PM: ​
12:22:00 PM: ────────────────────────────────────────────────────────────────
12:22:00 PM: Netlify Build
12:22:00 PM: ────────────────────────────────────────────────────────────────
12:22:00 PM: ​
12:22:00 PM: ❯ Version
12:22:00 PM: @netlify/build 18.7.2
12:22:00 PM: ​
12:22:00 PM: ❯ Flags
12:22:00 PM: baseRelDir: true
12:22:00 PM: buildId: 612dd16694e5ce000830f120
12:22:00 PM: deployId: 612dd16694e5ce000830f122
12:22:00 PM: ​
12:22:00 PM: ❯ Current directory
12:22:00 PM: /opt/build/repo
12:22:00 PM: ​
12:22:00 PM: ❯ Config file
12:22:00 PM: /opt/build/repo/netlify.toml
12:22:00 PM: ​
12:22:00 PM: ❯ Context
12:22:00 PM: deploy-preview
12:22:00 PM: ​
12:22:00 PM: ❯ Loading plugins
12:22:00 PM: - @netlify/plugin-nextjs@3.8.0 from Netlify app
12:22:01 PM: ​
12:22:01 PM: ────────────────────────────────────────────────────────────────
12:22:01 PM: 1. onPreBuild command from @netlify/plugin-nextjs
12:22:01 PM: ────────────────────────────────────────────────────────────────
12:22:01 PM: ​
12:22:01 PM: Using Next.js 10.1.2
12:22:01 PM: NOTE: Static HTML export Next.js projects (projects that use next export) do not require most of this plugin. For these sites, this plugin only caches builds.
12:22:01 PM: ​
12:22:01 PM: (@netlify/plugin-nextjs onPreBuild completed in 23ms)
12:22:01 PM: ​
12:22:01 PM: ────────────────────────────────────────────────────────────────
12:22:01 PM: 2. build.command from netlify.toml
12:22:01 PM: ────────────────────────────────────────────────────────────────
12:22:01 PM: ​
12:22:01 PM: $ npm run export
12:22:01 PM: > my-app@0.1.1 export
12:22:01 PM: > next build && next export -o ./dist
12:22:02 PM: (node:1349) [DEP0148] DeprecationWarning: Use of deprecated folder mapping β€œ./” in the β€œexports” field module resolution of the package at /opt/build/repo/node_modules/next/node_modules/postcss/package.json.
12:22:02 PM: Update this package.json to use a subpath pattern like β€œ./*”.
12:22:02 PM: (Use node --trace-deprecation ... to show where the warning was created)
12:22:03 PM: info - Using webpack 4. Reason: future.webpack5 option not enabled webpack5 | Next.js
12:22:03 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: no-cache | Next.js
12:22:03 PM: info - Checking validity of types…
12:22:10 PM: info - Creating an optimized production build…
12:22:31 PM: info - Compiled successfully
12:22:31 PM: info - Collecting page data…
12:22:33 PM: info - Generating static pages (0/17)
12:22:36 PM: info - Generating static pages (4/17)
12:22:36 PM: info - Generating static pages (8/17)
12:22:40 PM: Error occurred prerendering page β€œ/posts/welcome”. Read more: prerender-error | Next.js
12:22:40 PM: TypeError: Cannot read property β€˜name’ of undefined
12:22:40 PM: at PostLayout (/opt/build/repo/.next/server/pages/posts/[post].js:963:39)
12:22:40 PM: at d (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:498)
12:22:40 PM: at bb (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:16)
12:22:40 PM: at a.b.render (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:42:43)
12:22:40 PM: at a.b.read (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
12:22:40 PM: at exports.renderToString (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
12:22:40 PM: at Object.renderPage (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:854)
12:22:40 PM: at Function.getInitialProps (/opt/build/repo/.next/server/pages/_document.js:719:19)
12:22:40 PM: at loadGetInitialProps (/opt/build/repo/node_modules/next/dist/next-server/lib/utils.js:5:101)
12:22:40 PM: at renderToHTML (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:1145)
12:22:40 PM: info - Generating static pages (12/17)
12:22:40 PM: Error occurred prerendering page β€œ/posts/license”. Read more: prerender-error | Next.js
12:22:40 PM: TypeError: Cannot read property β€˜name’ of undefined
12:22:40 PM: at PostLayout (/opt/build/repo/.next/server/pages/posts/[post].js:963:39)
12:22:40 PM: at d (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:498)
12:22:40 PM: at bb (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:16)
12:22:40 PM: at a.b.render (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:42:43)
12:22:40 PM: at a.b.read (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
12:22:40 PM: at exports.renderToString (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
12:22:40 PM: at Object.renderPage (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:854)
12:22:40 PM: at Function.getInitialProps (/opt/build/repo/.next/server/pages/_document.js:719:19)
12:22:40 PM: at loadGetInitialProps (/opt/build/repo/node_modules/next/dist/next-server/lib/utils.js:5:101)
12:22:40 PM: at renderToHTML (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:1145)
12:22:40 PM: Error occurred prerendering page β€œ/posts/lorem-ipsum”. Read more: prerender-error | Next.js
12:22:40 PM: TypeError: Cannot read property β€˜name’ of undefined
12:22:40 PM: at PostLayout (/opt/build/repo/.next/server/pages/posts/[post].js:963:39)
12:22:40 PM: at d (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:498)
12:22:40 PM: at bb (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:16)
12:22:40 PM: at a.b.render (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:42:43)
12:22:40 PM: at a.b.read (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
12:22:40 PM: at exports.renderToString (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
12:22:40 PM: at Object.renderPage (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:854)
12:22:40 PM: at Function.getInitialProps (/opt/build/repo/.next/server/pages/_document.js:719:19)
12:22:40 PM: at loadGetInitialProps (/opt/build/repo/node_modules/next/dist/next-server/lib/utils.js:5:101)
12:22:40 PM: at renderToHTML (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:1145)
12:22:41 PM: Error occurred prerendering page β€œ/posts/rich-content-with-mdx”. Read more: prerender-error | Next.js
12:22:41 PM: TypeError: Cannot read property β€˜name’ of undefined
12:22:41 PM: at PostLayout (/opt/build/repo/.next/server/pages/posts/[post].js:963:39)
12:22:41 PM: at d (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:498)
12:22:41 PM: at bb (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:16)
12:22:41 PM: at a.b.render (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:42:43)
12:22:41 PM: at a.b.read (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
12:22:41 PM: at exports.renderToString (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
12:22:41 PM: at Object.renderPage (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:854)
12:22:41 PM: at Function.getInitialProps (/opt/build/repo/.next/server/pages/_document.js:719:19)
12:22:41 PM: at loadGetInitialProps (/opt/build/repo/node_modules/next/dist/next-server/lib/utils.js:5:101)
12:22:41 PM: at renderToHTML (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:1145)
12:22:41 PM: Error occurred prerendering page β€œ/posts/references”. Read more: prerender-error | Next.js
12:22:41 PM: TypeError: Cannot read property β€˜name’ of undefined
12:22:41 PM: at PostLayout (/opt/build/repo/.next/server/pages/posts/[post].js:963:39)
12:22:41 PM: at d (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:498)
12:22:41 PM: at bb (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:16)
12:22:41 PM: at a.b.render (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:42:43)
12:22:41 PM: at a.b.read (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
12:22:41 PM: at exports.renderToString (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
12:22:41 PM: at Object.renderPage (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:854)
12:22:41 PM: at Function.getInitialProps (/opt/build/repo/.next/server/pages/_document.js:719:19)
12:22:41 PM: at loadGetInitialProps (/opt/build/repo/node_modules/next/dist/next-server/lib/utils.js:5:101)
12:22:41 PM: at renderToHTML (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:1145)
12:22:41 PM: Error occurred prerendering page β€œ/posts/markdown-syntax”. Read more: prerender-error | Next.js
12:22:41 PM: TypeError: Cannot read property β€˜name’ of undefined
12:22:41 PM: at PostLayout (/opt/build/repo/.next/server/pages/posts/[post].js:963:39)
12:22:41 PM: at d (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:498)
12:22:41 PM: at bb (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:16)
12:22:41 PM: at a.b.render (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:42:43)
12:22:41 PM: at a.b.read (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
12:22:41 PM: at exports.renderToString (/opt/build/repo/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
12:22:41 PM: at Object.renderPage (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:854)
12:22:41 PM: at Function.getInitialProps (/opt/build/repo/.next/server/pages/_document.js:719:19)
12:22:41 PM: at loadGetInitialProps (/opt/build/repo/node_modules/next/dist/next-server/lib/utils.js:5:101)
12:22:41 PM: at renderToHTML (/opt/build/repo/node_modules/next/dist/next-server/server/render.js:54:1145)
12:22:41 PM: info - Generating static pages (17/17)
12:22:41 PM: > Build error occurred
12:22:41 PM: Error: Export encountered errors on following paths:
12:22:41 PM: /posts/license
12:22:41 PM: /posts/lorem-ipsum
12:22:41 PM: /posts/markdown-syntax
12:22:41 PM: /posts/references
12:22:41 PM: /posts/rich-content-with-mdx
12:22:41 PM: /posts/welcome
12:22:41 PM: at /opt/build/repo/node_modules/next/dist/export/index.js:31:1106
12:22:41 PM: at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:5:584)
12:22:41 PM: at async /opt/build/repo/node_modules/next/dist/build/index.js:43:49
12:22:41 PM: at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:5:584)
12:22:41 PM: at async /opt/build/repo/node_modules/next/dist/build/index.js:25:1475
12:22:41 PM: at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:5:584)
12:22:42 PM: ​
12:22:42 PM: ────────────────────────────────────────────────────────────────
12:22:42 PM: β€œbuild.command” failed
12:22:42 PM: ────────────────────────────────────────────────────────────────
12:22:42 PM: ​
12:22:42 PM: Error message
12:22:42 PM: Command failed with exit code 1: npm run export
12:22:42 PM: ​
12:22:42 PM: Error location
12:22:42 PM: In build.command from netlify.toml:
12:22:42 PM: npm run export
12:22:42 PM: ​
12:22:42 PM: Resolved config
12:22:42 PM: build:
12:22:42 PM: command: npm run export
12:22:42 PM: commandOrigin: config
12:22:42 PM: environment:
12:22:42 PM: - REVIEW_ID
12:22:42 PM: publish: /opt/build/repo/dist
12:22:42 PM: publishOrigin: config
12:22:42 PM: plugins:
12:22:42 PM: - inputs: {}
12:22:42 PM: origin: ui
12:22:42 PM: package: β€˜@netlify/plugin-nextjs’
12:22:43 PM: Caching artifacts
12:22:43 PM: Started saving node modules
12:22:43 PM: Finished saving node modules
12:22:43 PM: Started saving build plugins
12:22:43 PM: Finished saving build plugins
12:22:43 PM: Started saving yarn cache
12:22:47 PM: Finished saving yarn cache
12:22:47 PM: Started saving pip cache
12:22:47 PM: Finished saving pip cache
12:22:47 PM: Started saving emacs cask dependencies
12:22:47 PM: Finished saving emacs cask dependencies
12:22:47 PM: Started saving maven dependencies
12:22:47 PM: Finished saving maven dependencies
12:22:47 PM: Started saving boot dependencies
12:22:47 PM: Finished saving boot dependencies
12:22:47 PM: Started saving rust rustup cache
12:22:47 PM: Finished saving rust rustup cache
12:22:47 PM: Started saving go dependencies
12:22:47 PM: Finished saving go dependencies
12:22:47 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:22:47 PM: Creating deploy upload records
12:22:47 PM: Failing build: Failed to build site
12:22:47 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2
12:22:47 PM: Finished processing build request in 1m26.944791507s

While I’m not familiar with NextJS, have you actually checked the link that the logs suggest:

If you did and the problem occurs only after you add the code (maybe you added it via snippet injection), could you try to directly add it to your page?

Is it possible that these posts don’t exist?

Hey guys this issue is resolved, I had forgotten to inject a code snippet before the body tag.

Thanks all for your support!

1 Like

Thanks for coming back and letting us know! :netliconfetti:

1 Like