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

Dynamic require in dependencies breaking apps with version 0.49.0 #16198

Closed
tinkrtailor opened this issue Oct 4, 2017 · 2 comments
Closed

Dynamic require in dependencies breaking apps with version 0.49.0 #16198

tinkrtailor opened this issue Oct 4, 2017 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@tinkrtailor
Copy link

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.5
Node: 7.10.0
Yarn: 0.24.5
npm: 4.2.0
Watchman: 4.7.0
Xcode: Xcode 8.3.3 Build version 8E3004b
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.49.0 => 0.49.0

Steps to Reproduce

prerequisite: Have a react-native app with version 0.49.0

  1. Install and use a package with dynamic imports statements such as moment.js
  2. Run the app
  3. Witness red screen of death notifying of TransformError

Expected Behavior

I expected the project to build and run as it did for the RN version I was using before (0.48.4).

Actual Behavior

I got an error saying that a require() must have a string literal argument. Even though the responsible for this error was located in the source code of a dependency (Moment.js)
require('./locale/' + name);

screen shot 2017-10-04 at 11 20 19

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

@nihgwu
Copy link
Contributor

nihgwu commented Oct 4, 2017

moment/moment#4187

@tinkrtailor
Copy link
Author

@nihgwu Thank you for pointing this out to me. I thought I had checked moment's github for this error but somehow missed it

@facebook facebook locked as resolved and limited conversation to collaborators Oct 4, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants