-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Webpack warnings trigger build errors when running on CI #1150
Comments
My initial idea was to check warnings to see if there are any related to Warnings emitted by I couldn't find anything else that would mention |
Agree. I’m not sure about this specific fix but please send a PR to get the ball rolling. |
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 [
'/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 edit. Maybe we could use |
Same issue here. My temporary workaround was to unset #...
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
#... |
@kachkaev Are there any side effects? Because of this, I'm still stuck at 0.7.5. |
@scholtzm I have not noticed any. Please share yours – others (including myself) may face them in the next project. |
Maybe we can ask Webpack to expose a way to turn that warning off? I never found it useful. |
@kachkaev Thinking about it right now, I think Jest uses @gaearon As per my initial post here, in my particular case, I'd have to use |
Why not change the logic to |
Because that's the opposite of the intention. The intention is to fail CI on warnings (but only useful warnings coming from ESLint). FWIW I did try this with master, and I can’t reproduce this specific warning anymore. Which library should I try with? |
In my case, it was triggered by |
Can you provide a code snippet? |
Just simple import will trigger the warning. https://github.com/scholtzm/arnold/blob/master/src/util/storage.js#L1 |
That's my point. Eslint has errors and warnings, and changing the behaviour to treat warnings as errors is changing the semantics. When really they should just be changed to errors in cra's eslint config. |
Please see past discussions when people repeatedly asked to treat warnings as errors in CI. This is common practice. |
@scholtzm Can you check if the issue reproduces on master? |
I will report back this weekend. |
fwiw, I've been getting the initial |
The funny thing is we didn’t actually do anything to suppress it. I have no idea why it’s gone 😄 |
I’ll close for now but if somebody can reproduce please give me instructions. |
Haha, MYSTERY FIX I'll keep an eye out on my end for any weird changes here regardless. |
(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.The text was updated successfully, but these errors were encountered: