Skip to content

CRA 2 'Failed to compile' when running 'build' #5312

Closed

Description

@multum

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes. Additionally, I made a clean installation on another machine.

Which terms did you search for in User Guide?

'Updating to New Releases'

Environment

Environment:
OS: macOS 10.14
Node: 8.11.3
Yarn: Not Found
npm: 5.6.0
Watchman: Not Found
Xcode: Xcode 10.0 Build version 10A255
Android Studio: Not Found

Packages: (wanted => installed)
react: ^16.5.2 => 16.5.2
react-dom: ^16.5.2 => 16.5.2
react-scripts: ^2.0.4 => 2.0.4

Steps to Reproduce

npm run build

Expected Behavior

successful build

Actual Behavior

Error

Reproducible Demo

'Component' is a functional component.
Code

Activity

  1. stereobooster commented on Oct 5, 2018

    @stereobooster
    Contributor

    Can you please provide reproducible demo? Thanks

  2. added this to the 2.x milestone on Oct 5, 2018
  3. gaearon commented on Oct 5, 2018

    @gaearon
    Contributor

    Probably a bug in the prop-types transform.

  4. multum commented on Oct 5, 2018

    @multum
    Author

    @stereobooster I'm not sure that I can reproduce the error ... This happens only when you run the command npm run build

  5. multum commented on Oct 5, 2018

    @multum
    Author

    @gaearon The error appears only when determining the prop-type as follows
    [SOME_CONSTANT] : PropTypes.arrayOf(...) or PropTypes.oneOfType(...).

    Determining a key without a constant and [] leads to a successful build
    someKey : PropTypes.arrayOf(...) or PropTypes.oneOfType(...)

  6. modified the milestones: 2.x, 2.0.x, 2.0.5 on Oct 5, 2018
  7. Timer commented on Oct 8, 2018

    @Timer
    Contributor
  8. oliviertassinari commented on Oct 13, 2018

    @oliviertassinari

    @AV-Dev If you could provide a full reproducing example on https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types side, it would be awesome :).

  9. modified the milestones: 2.0.5, 2.0.6 on Oct 14, 2018
  10. multum commented on Oct 16, 2018

    @multum
    Author

    @oliviertassinari Hi! Download bug example and run npm i && npm run babel

    TypeError: Cannot read property 'type' of undefined at memberExpressionRootIdentifier (D:\Example\node_modules\babel-plugin-transform-react-remove-prop-types\lib\index.js:105:39)

    105 line in code while (memberExpression.node.object.type === 'MemberExpression') {

  11. oliviertassinari commented on Oct 16, 2018

    @oliviertassinari

    @AV-Dev Great, thank you!

  12. modified the milestones: 2.1.1, 2.1.x on Oct 31, 2018
  13. oliviertassinari commented on Nov 6, 2018

    @oliviertassinari

    It should be fixed with v0.4.20, thank you @lukeapage!

  14. NMinhNguyen commented on Jan 12, 2019

    @NMinhNguyen
    Contributor

    @Timer I believe this can now be closed thanks to 5c3f333 (was this commit pushed without a PR?) which uses babel-plugin-transform-react-remove-prop-types@0.4.20.

  15. modified the milestones: 2.1.x, 3.x on Mar 10, 2019
  16. locked and limited conversation to collaborators on Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions