question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fails to build when using react-native bundler

See original GitHub issue

Hi!

I’ve be trying to use lingui within a react-native project but I have an issue using the lingui-react babel. Running react-native start will fail with the following error, which is not really helping:

error: bundling failed: TypeError: /Users/arnaud/projects/slite/mobile/node_modules/lingui-react/dist/index.js: undefined is not iterable!
    at module.exports.require.getIterator (/Users/arnaud/projects/slite/mobile/node_modules/core-js/library/modules/core.get-iterator.js:5:42)
    at processMethod (/Users/arnaud/projects/slite/mobile/node_modules/babel-plugin-lingui-transform-js/dist/index.js:53:30)

I think I don’t have any error in my setup, which is dead simple:

Relevant deps:

"react-native": "0.50.3",
"lingui-i18n": "^1.3.2",
"lingui-react": "^1.3.4",
"babel-preset-lingui-react": "^1.0.9",
"babel-preset-react-native": "4.0.0",

Lingui config:

{
  "fallbackLocale": "en",
  "sourceLocale": "en",
  "localeDir": "<rootDir>/src/locale",
  "srcPathDirs": [
    "<rootDir>/src"
  ],
  "srcPathIgnorePatterns": [
    "/node_modules/"
  ],
  "format": "lingui"
}

.babelrc:

{
  "presets": [
    "react-native",
    "lingui-react"
  ]
}

File structure:

screen shot 2017-11-13 at 17 21 04

The build works fine when I remove lingui-react from .babelrc but then I get the fair warning:

screen shot 2017-11-13 at 17 31 32

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tricoder42commented, Nov 13, 2017

Hi, I’m off until Wednesday. I’ll let you know once I’m back online 👍

    1. 2017 v 17:23, Arnaud Rinquin notifications@github.com:

Hi!

I’ve trying using lingui withing react native but I have an issue using the lingui-react babel plugin.

error: bundling failed: TypeError: /Users/arnaud/projects/slite/mobile/node_modules/lingui-react/dist/index.js: undefined is not iterable! at module.exports.require.getIterator (/Users/arnaud/projects/slite/mobile/node_modules/core-js/library/modules/core.get-iterator.js:5:42) at processMethod (/Users/arnaud/projects/slite/mobile/node_modules/babel-plugin-lingui-transform-js/dist/index.js:53:30) I think I don’t have any error in my setup, which is dead simple:

Relevant deps:

“react-native”: “0.50.3”, “lingui-i18n”: “^1.3.2”, “lingui-react”: “^1.3.4”, “babel-preset-lingui-react”: “^1.0.9”, “babel-preset-react-native”: “4.0.0”, Lingui config:

{ “fallbackLocale”: “en”, “sourceLocale”: “en”, “localeDir”: “<rootDir>/src/locale”, “srcPathDirs”: [ “<rootDir>/src” ], “srcPathIgnorePatterns”: [ “/node_modules/” ], “format”: “lingui” } .babelrc:

{ “presets”: [ “react-native”, “lingui-react” ] } File structure:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

0reactions
tricoder42commented, Nov 16, 2017

Great, thank you! 👍 Getting exposure is hard, but people are starting using it, talking about it and writing blog posts, so it should get better 😃

If you wish I could mention your project/company in README to get a bit of social proof

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native app failed to build while trying to bundle release
try this,. Close metro server if is opend watchman shutdown-server; for delete node-modules and re install and clear-cache watchman ...
Read more >
npx react-native init project failure while installing Bundler ...
Hello, I am trying to initialize a new project by following the steps in Setting Up the Development Environment. I get an error...
Read more >
Troubleshooting - React Native
Using a port other than 8081​ ... You will also need to update your applications to load the JavaScript bundle from the new...
Read more >
Error Boundaries - React
Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI...
Read more >
Troubleshooting build errors and crashes - Expo Documentation
A reference for troubleshooting build errors and crashes when using EAS Build. ... a native iOS build, it means Metro bundler failed to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found