Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-i18next throwing webpack error when initializeing using @babel/runtime 7.3.0 #685

Closed
guiyep opened this issue Jan 22, 2019 · 7 comments
Closed

Comments

@guiyep
Copy link

@guiyep guiyep commented Jan 22, 2019

since the dependency with @babel/runtime is anything from 7.1.2 with the latest update on @babel/runtime 7.3.0 (today) the library stops working. Had to manually downgrade the version to 7.1.2 to make the library work again.

@jamuhl

This comment has been minimized.

Copy link
Member

@jamuhl jamuhl commented Jan 22, 2019

? do you build react-i18next yourself? the runtime gets embedded during build time - so you should not really need/depend on it?

can you give a little more information what you are doing - and how you run into this?

@jamuhl

This comment has been minimized.

Copy link
Member

@jamuhl jamuhl commented Jan 22, 2019

Just updated all dependencies -> as i guess it might be related to babel-runtime update

did a republish of react-i18next@9.0.6 does using that resolve your issue?

@pedrorezende

This comment has been minimized.

Copy link

@pedrorezende pedrorezende commented Jan 22, 2019

I guess I'm having a related problem. Just started a brand new create-react-app project yesterday, installed react-i18next and i18next and reused the same code I was using in another project. But today I'm getting the following error.

Uncaught TypeError: Cannot convert undefined or null to object
    at Function.getOwnPropertyDescriptors (<anonymous>)
    at _objectSpread (objectSpread.js:19)
    at setDefaults (context.js:23)
    at Object.init (context.js:37)
    at i18next.js:187
    at Array.forEach (<anonymous>)
    at I18n.init (i18next.js:186)
    at Module../src/index.js (index.js:9)
    at __webpack_require__ (bootstrap:782)
    at fn (bootstrap:150)
    at Object.0 (WarningPanel.module.scss?c11d:45)
    at __webpack_require__ (bootstrap:782)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.chunk.js:1
@jamuhl

This comment has been minimized.

Copy link
Member

@jamuhl jamuhl commented Jan 22, 2019

could you try with react-i18next@9.0.7

@guiyep

This comment has been minimized.

Copy link
Author

@guiyep guiyep commented Jan 22, 2019

I'm getting the exact same issue as described before. Not cloning the repo just npm installing it and then initialising it as follow:

import { reactI18nextModule } from 'react-i18next';

// i18next configuration
const config = {
  resources,
  fallbackLng: 'en-AU',
  lng: 'en-AU',
  keySeparator: false,
  interpolation: {
    format(value, format, lng) {
      return formatterExecutor(allFormatters, value, format, lng);
    },
    escapeValue: false,
  },
};
const i18next = i18n.use(reactI18nextModule).init(config);

this all started to happen as soon as we did a fresh install of out app that was downloading the latest version of @babel/runtime 7.3.0 if I force to install first an older version before react-I18next is installed the issue do not happens.

@jamuhl

This comment has been minimized.

Copy link
Member

@jamuhl jamuhl commented Jan 23, 2019

still an issue with react-i18next@9.0.7 ?!? should not be the case as confirmed by #686

beside that please be aware const i18next = i18n.use(reactI18nextModule).init(config); here i18next will be a Promise not the i18next instance if using i18next >= v13.0.0

@pedrorezende

This comment has been minimized.

Copy link

@pedrorezende pedrorezende commented Jan 23, 2019

Hi @jamuhl . Thanks for the support. Setting the version of react-i18next to 9.0.7 fixed the problem for me.

@jamuhl jamuhl closed this Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.