ch1ffa / relay-compiler-webpack-plugin

MIT License
10 stars 1 forks source link

Warnings cause compilation errors #6

Open steinybot opened 2 years ago

steinybot commented 2 years ago

Some warnings or other informative messages go to stderr. For example:

Debugger listening on ws://127.0.0.1:56587/f01b9c7c-094d-4757-a650-020f63e40d9c
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
(node:54655) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:54655) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
Waiting for the debugger to disconnect...

These are copied to errorMessages in https://github.com/ch1ffa/relay-compiler-webpack-plugin/blob/main/src/compiler.ts#L38 and subsequently converted to compilationErrors in https://github.com/ch1ffa/relay-compiler-webpack-plugin/blob/main/src/plugin.ts#L58.

I think the best thing to do is to check the exit code before determining whether the messages should be errors or not.

ch1ffa commented 2 years ago

Hi @steinybot! Thank you for your contribution! I need more time to test it. But I'm not quite sure what causes these warnings. Can you help me with a simple reproduction?