-
Notifications
You must be signed in to change notification settings - Fork 608
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-native bundler takes exponentially longer (eventually timing out) for very large js files. #123
Comments
Hey @ScottPierce, Thanks for reporting this! This seems to be an issue with Babel, which may not have a linear execution time to transform a file. I would suggest to not transform the You can ignore certain files from being transformed by Babel if you add an ignore pattern in your .babelrc file. Can you try to do this and let me know if this improves things? |
Hey! That works. It took a few seconds to package, but everything loaded. I created a {
"ignore": [
"**/kotlin.js"
]
} For some reason, including the babel config inside my package.json (as the documentation suggests you can do) did not work. @rafeca Thanks! I don't suppose you have a recommendation for how to have metro include the generated sourcemaps for kotlin.js and my compiled kotlin module? Right now react-native seems to be ignoring them completely, making it impossible to debug, and also stacktraces are somewhat useless because they are based off of the generated js code. |
@ScottPierce You can probably still parse kotlin.js in a custom transformer using only I'm assuming |
Closing this since the opening issue is resolved. |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment:
OS: macOS High Sierra 10.13.2
Node: 6.3.1
Yarn: Not Found
npm: 3.10.3
Watchman: 4.6.0
Xcode: Xcode 8.0 Build version 8A218a
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.0.0-beta.5 => 16.0.0-beta.5
react-native: ^0.51.0 => 0.51.0
Steps to Reproduce
Steps to reproduce this can be found in the README in the following repo: https://github.com/ScottPierce/ReactNativeKotlinError
Expected Behavior
That the kotlin.js file from npm, or other large javascript files, could properly be bundled with react-native.
Actual Behavior
Bundling kotlin.js freezes:
And eventually times out:
I removed most of the content from the javascript file, and things bundled just fine. I slowly added more and more content back to the kotlin.js file, and bundling times rose exponentially. Here are some rough estimates:
Reproducible Demo
https://github.com/ScottPierce/ReactNativeKotlinError
This bug was created from facebook/react-native#17485 (comment)
The text was updated successfully, but these errors were encountered: