ReactNativeLocalization icon indicating copy to clipboard operation
ReactNativeLocalization copied to clipboard

A WeakMap cannot have a non-object key

Open ansmonjol opened this issue 9 years ago • 1 comments

Hello,

When the Live reload and Hot reloading are enabled on my virtual device I get the error A WeakMap cannot have a non-object key.

This error occur when I save a file where I've imported and used my Translation service or when I save my translation json.

Here is the error screen: screen shot 2016-09-08 at 17 52 58

The File with translations:

import LocalizedStrings from 'react-native-localization';

let Translate = new LocalizedStrings({
  en:{
    // Errors
    errorNetworkRequest: 'An error occurred while making a network request',
   ...
  },
  it: {
    ...
  }
});

export default Translate;

Then I import my translation file with import Translate from 'MyProject/src/lib/utils/Translate'; or user it from props

Thanks in advance

ansmonjol avatar Sep 08 '16 17:09 ansmonjol

Have you created the app using create-react-native-app?

Because from the screenshot it seems so... and

Because you don't build any native code when using Create React Native App to create a project, it's not possible to include custom native modules beyond the React Native APIs and components that are available in the Expo client app.

stefalda avatar Jun 08 '17 22:06 stefalda