next.js: r.isMemo is not a function

Bug report

Describe the bug

after doing the deploy with now I get error 500. in the now logs I have seen this error r.isMemo is not a function. in debug this function if it exists and no error has been obtained.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. run - now
  2. run - now log <domain | alias>

captura de pantalla 2019-01-24 a la s 07 18 12

System information

  • macOS
  • Browser all
  • Version of Next.js 7.0.2
  • Now version 13.1.2-canary.3

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 36 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Thank you very much @sebastiansson, because of your reproduction it was trivial to pinpoint the actual issue (took me 10 minutes). This is a great example of why providing a clear reproduction gets your issue solved faster 🙏

I’ve just tagged a new canary release holding the fix, it will take ~15-20 minutes for it to become available on npm because of test runs etc.

Once it’s available use this comment to upgrade your application: https://github.com/zeit/next.js/issues/5750#issuecomment-451607604

@timneutkens

I’m experiencing the same issue. I created a repo and deployed it with Now. I made it with npx create-next-app --example with-redux-wrapper The breaking seems to happen when I update the dependencies in my package.json file.

Working versions on Now https://next-ismemo-hoyaaj0kt.now.sh (commit) https://next-ismemo-1ejnp2zr8.now.sh (commit)

Broken version on Now https://next-ismemo-i7l0sp7lo.now.sh/ (commit).

See the log file below for information about the broken https://next-ismemo-i7l0sp7lo.now.sh deployment in Now. broken_logs.txt

@machester4 Having the same issue and I’m not sure why, also in ../pages/index.js. Mind sharing your package.json? Here’s mine:

...
  "dependencies": {
    "@contentful/rich-text-html-renderer": "^12.1.2",
    "@zeit/next-css": "^1.0.1",
    "contentful": "^7.1.0",
    "dotenv-webpack": "^1.6.0",
    "express": "^4.16.4",
    "html-to-react": "^1.3.4",
    "next": "^7.0.2",
    "next-redux-wrapper": "^2.1.0",
    "postcss-easy-import": "^3.0.0",
    "react": "^16.7.0",
    "react-dom": "^16.7.0",
    "react-dom-confetti": "0.0.10",
    "react-pose": "^4.0.6",
    "react-redux": "^6.0.0",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-persist": "^5.10.0",
    "styled-components": "^4.1.3"
  },
  "devDependencies": {
    "autoprefixer": "^9.4.5",
    "babel-plugin-styled-components": "^1.10.0",
    "cssnano": "^4.1.8",
    "postcss-import": "^12.0.1",
    "tailwindcss": "^0.7.3"
  }
...

Just to check in here again, this has been released under stable 🙏

@sebastiansson Happy to 🙏

Re debugging: So you can run next build locally and it will output the serverless page bundles in .next/serverless/pages, then you can run the bundle using a simple Node.js HTTP server as described here: https://github.com/zeit/next.js#one-level-lower

With relation to how I knew what was going on, I knew that we added react-is to the dependencies of Next.js in the canary branch, isMemo sounded like something coming from there, so it made sense to check there. Then I noticed how there was no isMemo in the version of react-is that Next.js has so I noticed it must have been something in module resolution. I remembered another open issue related to module resolving with Next.js node_modules taking priority so I checked the node_modules resolve rules and indeed it was causing the issue. So removing it solved both this issue and the other open issue.

Pinning react-redux to 4.4.9 sorts it out for me, but is far from ideal.

My app builds and runs fine in production mode on my machine with react-redux set to ^6.0.0. But it fails with the r.isMemo... error when deploying to now.

Old versions of my app that I deployed with no problem, fail to be deploy to now at the moment. And they have a yarn.lock file. So, as @paulogdm mentions here it could be a regression in a now builder.

Everyone as slow as me, the solution for this problem is just to install: next@canary. Even with redux it works quite fine. Also with now 14. However check at this, as you need to fix this because of the necessary next upgrade: https://github.com/zeit/now-builders/blob/master/errors/now-next-no-serverless-pages-built.md

Did you upgrade to next@canary?

I’m not using redux, but I’m still encountering this issue.

Hey, I’m having a similar issue all of a sudden but with n.isMemo is not a function

I don’t have redux though and it’s happened all of a sudden when I just updated some CSS on my project.

I can get it to work if I switch the now build from @now/next to @now/static-build temporarily.

Any thoughts?