Skip to content

Build errors are not printed to console due to broken require #2936

Closed

Description

@svicalifornia

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes.

The Problem

Build errors do not print to console to due to an fatal error introduced in PR #2650.

PR #2650 added a new file printBuildError.js, which requires lodash/get. However, lodash is not listed as a dependency in react-script's package.json, so any execution path that requires printBuildError.js will fail to require 'lodash/get', causing node to throw a fatal exception.

Proposed Resolution

'lodash' or 'lodash.get' should be added to package.json, or the 'lodash/get' require should be removed from printBuildError.js.

Activity

  1. gaearon commented on Aug 10, 2017

    @gaearon
    Contributor

    Also worth looking into why this didn't fail CI.

  2. Timer commented on Aug 10, 2017

    @Timer
    Contributor

    Hi @svicalifornia; I'd love a bit more information -- are you ejected?

  3. Timer commented on Aug 10, 2017

    @Timer
    Contributor

    Also, what version of npm are you using?

    Really, this shouldn't bomb out with npm >= 3 as it does dependency flattening and lodash is required by inquirer. Though it'd be technically correct to include lodash -- this should only blow up on npm < 3.

  4. Timer commented on Aug 10, 2017

    @Timer
    Contributor

    Fix up in #2938.

  5. Timer commented on Aug 10, 2017

    @Timer
    Contributor

    Released in react-dev-utils@3.1.1. Please upgrade!

  6. svicalifornia commented on Aug 10, 2017

    @svicalifornia
    Author

    @Timer My colleague and I experienced the issue on systems running npm 4.2 and 5.1.0.

    Thanks for the quick fix!

  7. Timer commented on Aug 10, 2017

    @Timer
    Contributor

    Are you ejected?

  8. svicalifornia commented on Aug 10, 2017

    @svicalifornia
    Author

    We are not ejected, but we are using react-app-rewired to add loaders and plugins to our webpack config.

  9. Timer commented on Aug 11, 2017

    @Timer
    Contributor

    Hmm interesting. Non determinism at its finest haha.
    Glad all is working now!

  10. locked and limited conversation to collaborators on Jan 21, 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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions