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

After upgrading to React-Native 0.56.0 metro build fails (TypeError: Cannot read property 'ast' of null) #20247

Closed
3 tasks done
djschilling opened this issue Jul 17, 2018 · 4 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@djschilling
Copy link

Environment

Run react-native info in your terminal and paste its contents here.

  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.5
      CPU: x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
      Memory: 45.86 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        Build Tools: 23.0.1, 25.0.1, 26.0.2, 27.0.3, 28.0.0
        API Levels: 23, 25, 26, 27
    IDEs:
      Android Studio: 3.1 AI-173.4819257
      Xcode: 9.4/9F1027a - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.1 => 16.4.1
      react-native: 0.56.0 => 0.56.0
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description

After upgrading to react-native version 0.56.0 my metro build fails with the error message TypeError: Cannot read property 'ast' of null.
I also read this issue #19827 but could not fix my issue with the suggestions there.

From the error message it seams the bug is in the metro src.

Detailed error message:

error: bundling failed: TypeError: Cannot read property 'ast' of null
    at Object.transform (/Users/david/projects/churchtools-mobile/node_modules/metro/src/reactNativeTransformer.js:167:48)
    at Object.<anonymous> (/Users/david/projects/churchtools-mobile/node_modules/metro/src/JSTransformer/worker.js:204:23)
    at Generator.next (<anonymous>)
    at step (/Users/david/projects/churchtools-mobile/node_modules/metro/src/JSTransformer/worker.js:328:291)
    at /Users/david/projects/churchtools-mobile/node_modules/metro/src/JSTransformer/worker.js:328:521
    at new Promise (<anonymous>)
    at Object.<anonymous> (/Users/david/projects/churchtools-mobile/node_modules/metro/src/JSTransformer/worker.js:328:202)
    at Object.transformCode [as transform] (/Users/david/projects/churchtools-mobile/node_modules/metro/src/JSTransformer/worker.js:292:93)
    at execMethod (/Users/david/projects/churchtools-mobile/node_modules/jest-worker/build/child.js:90:29)
@ptmt
Copy link
Contributor

ptmt commented Aug 13, 2018

Do you have ignore section in your .babelrc by any chance? It doesn't work for me well (config gets unresolved, and babel transformation fails), so I removed this section for now. Probably also need to test with newer babel / metro and file an issue.

@helenaford
Copy link
Contributor

Wish there was a solution for this. Ignore was working for me before I upgraded my babel from beta.47 to 7.0.0. Issue is with React-Native 0.57.0 too.

@jkimbo
Copy link
Contributor

jkimbo commented Sep 23, 2018

This looks like a bug in metro. I found a patch that fixes it: facebook/metro#255 (comment)

@stale
Copy link

stale bot commented Dec 23, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@hramos hramos removed the Bug Report label Feb 6, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

8 participants