Skip to content

Webpack warnings trigger build errors when running on CI #1150

Closed

Description

@scholtzm

(Initial discussion starts here.)

Pull request #944 adds a new behaviour related to CIs - crash the build during CI whenever linter warnings are encountered.

This PR however introduced new side effect - webpack warnings will also crash the build, e.g.:

This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.

We could consider this particular warning to be harmless.
Since we have no access to webpack config, we cannot use module.noParse option either.

Activity

  1. scholtzm commented on Dec 4, 2016

    @scholtzm
    ContributorAuthor

    My initial idea was to check warnings to see if there are any related to eslint-loader.

    Warnings emitted by eslint-loader contain full loader path, e.g. /long/path/to/node_modules/eslint-loader/index.js.

    I couldn't find anything else that would mention eslint or eslint-loader that could be also reliably used to determine that a specific warning comes from ESLint.

  2. added this to the 0.8.2 milestone on Dec 5, 2016
  3. gaearon commented on Dec 5, 2016

    @gaearon
    Contributor

    Agree. I’m not sure about this specific fix but please send a PR to get the ball rolling.
    Then we can consider alternatives.

  4. scholtzm commented on Dec 5, 2016

    @scholtzm
    ContributorAuthor

    I dug a bit further and couldn't find anything that would provide information about which loader emitted the warning in a reliable manner.

    For example an ESLint warning about eqeqeq, loaders property looks like this:

    [
      '/system/path/node_modules/babel-loader/index.js?{"babelrc":false,"presets":["/system/path/node_modules/babel-preset-react-app/index.js"]}',
      '/system/path/node_modules/eslint-loader/index.js'
    ]

    There's also issuer and request which are just long ! webpack strings formed from the info above.

    edit. Maybe we could use failOnError and failOnWarning provided by eslint-loader.

  5. modified the milestones: 0.8.3, 0.8.2, 0.9.0 on Dec 6, 2016
  6. kachkaev commented on Dec 18, 2016

    @kachkaev

    Same issue here. My temporary workaround was to unset CI variable in the build script (using .gitlab-ci.yml):

    #...
    
    build-app:
      stage: build-app
      cache:
        paths:
          - node_modules
        key: "node_modules"
        untracked: true
      script:
        - npm install
        - unset CI # <-------- this line helped
        - npm run build
      artifacts:
        paths:
          - build
    
    #...
  7. modified the milestones: 1.0.0, 0.9.0 on Jan 23, 2017
  8. scholtzm commented on Feb 11, 2017

    @scholtzm
    ContributorAuthor

    @kachkaev Are there any side effects? Because of this, I'm still stuck at 0.7.5.

  9. kachkaev commented on Feb 11, 2017

    @kachkaev

    @scholtzm I have not noticed any. Please share yours – others (including myself) may face them in the next project.

  10. gaearon commented on Feb 11, 2017

    @gaearon
    Contributor

    Maybe we can ask Webpack to expose a way to turn that warning off? I never found it useful.

  11. 9 remaining items

  12. gaearon commented on May 18, 2017

    @gaearon
    Contributor

    Please see past discussions when people repeatedly asked to treat warnings as errors in CI. This is common practice.

  13. gaearon commented on May 18, 2017

    @gaearon
    Contributor

    @scholtzm Can you check if the issue reproduces on master?

  14. scholtzm commented on May 18, 2017

    @scholtzm
    ContributorAuthor

    I will report back this weekend.

  15. modified the milestones: 1.0.1, , 1.0.x on May 18, 2017
  16. holman commented on May 22, 2017

    @holman

    fwiw, I've been getting the initial This seems to be a pre-built javascript file warning for some time, but I just upgraded to 1.0.x and it's being suppressed correctly now. ✨

  17. gaearon commented on May 22, 2017

    @gaearon
    Contributor

    The funny thing is we didn’t actually do anything to suppress it. I have no idea why it’s gone 😄

  18. gaearon commented on May 22, 2017

    @gaearon
    Contributor

    I’ll close for now but if somebody can reproduce please give me instructions.

  19. holman commented on May 22, 2017

    @holman

    Haha, MYSTERY FIX

    I'll keep an eye out on my end for any weird changes here regardless.

  20. 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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions