Skip to content

Packager: Transform Times Out on Large Json File #12590

@mattbierner

Description

@mattbierner

Description

Try to require a large json file, such as that found in the cmu-pronouncing-dictionary module

Reproduction

const cmu = require('cmu-pronouncing-dictionary')

Here's the actual 4.5MB file: https://github.com/zeke/cmu-pronouncing-dictionary/master/index.json

I also tried changing the json to a regular js module but hit the same issue. Here's the log:

Bundling `index.ios.js`
  Transforming modules  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░  99.5% (406/407)...Error: TimeoutError: transforming XXX/build/cmu.js took longer than 301 seconds.
You can adjust timeout via the 'transformTimeoutInterval' option
    at _transform.then.catch.error (XXX/node_modules/react-native/packager/src/JSTransformer/index.js:163:30)
    at process._tickCallback (internal/process/next_tick.js:103:7)
(node:36165) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 669): Error: TimeoutError: transforming XXX/build/cmu.js took longer than 301 seconds.
You can adjust timeout via the 'transformTimeoutInterval' option

Solution

Address the performance issue that is causing the processing of this file to take so long

Additional Information

  • React Native version: 0.41
  • Platform: iOS
  • Operating System: MacOS 10.11.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions