i18next / next-i18next

The easiest way to translate your NextJs apps.
https://next.i18next.com
MIT License
5.51k stars 762 forks source link

ReactIs.isMemo is not a function #203

Closed hnq90 closed 5 years ago

hnq90 commented 5 years ago

Describe the bug

When I try to use appWithTranslation HOC with _app.js, I got following error:

Note that pages will be compiled when you first load them.
TypeError: ReactIs.isMemo is not a function
    at getStatics (/usr/src/app/.next/server/static/development/pages/_app.js:2457:17)
    at hoistNonReactStatics (/usr/src/app/.next/server/static/development/pages/_app.js:2487:29)
    at hoistNonReactStatics (/usr/src/app/.next/server/static/development/pages/_app.js:2477:17)
    at hoistNonReactStatics (/usr/src/app/.next/server/static/development/pages/_app.js:2477:17)
    at hoistNonReactStatics (/usr/src/app/.next/server/static/development/pages/_app.js:2477:17)
    at NextI18Next._default (/usr/src/app/.next/server/static/development/pages/_app.js:1658:44)
    at Module../pages/_app.tsx (/usr/src/app/.next/server/static/development/pages/_app.js:5539:133)
    at __webpack_require__ (/usr/src/app/.next/server/static/development/pages/_app.js:23:31)
    at Object.0 (/usr/src/app/.next/server/static/development/pages/_app.js:9230:18)
    at __webpack_require__ (/usr/src/app/.next/server/static/development/pages/_app.js:23:31)
    at /usr/src/app/.next/server/static/development/pages/_app.js:91:18
    at Object.<anonymous> (/usr/src/app/.next/server/static/development/pages/_app.js:92:12)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module.m._compile (/usr/src/app/node_modules/ts-node/src/index.ts:413:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.require.extensions.(anonymous function) [as .js] (/usr/src/app/node_modules/ts-node/src/index.ts:416:12)

Occurs in next-i18next version

isaachinman commented 5 years ago

What version of React are you on? This is a TypeScript project? Can you please provide a reproducible example?

hnq90 commented 5 years ago

@isaachinman Yes, it's TypeScript project with React 16.8.2. The error occurred after adding that HOC and refresh the browser.

isaachinman commented 5 years ago

https://github.com/zeit/next.js/issues/6117

hnq90 commented 5 years ago

@isaachinman I read it before but it still works before I added appWithTranslation...

isaachinman commented 5 years ago

Can you please provide a reproducible example?

mengqing commented 5 years ago

I am also getting this issue after upgraded to the latest version of next-i18next

react@16.8.4 next@8.0.3 next-i18next@0.36.4

isaachinman commented 5 years ago

@mengqing https://github.com/zeit/next.js/issues/6117