launchcodedev / app-config

Easy Configuration Loader with Strict Validation
https://app-config.dev
Mozilla Public License 2.0
69 stars 11 forks source link

Unhelpful error when using an invalid config with webpack-dev-server #88

Closed johnb8 closed 3 years ago

johnb8 commented 3 years ago

Running webpack-dev-server in a project using webpack and the app-config webpack plugin with an invalid app-config config gives an unhelpful This dependency was not found: @lcdev/appconfig error. It would be nice if app-config errors could be shown as well, like when just running webpack. Not sure if that's a limitation of webpack-dev-server, but it should probably be documented somewhere at least.

joelgallant commented 3 years ago

You're using CleanWebpackPlugin or something too? When running our example project, I see the following:

01-13-1610543969

johnb8 commented 3 years ago

Oh yeah I'm using friendly-errors-webpack-plugin with quiet: true in the devServer settings of webpack. It gives an app-config error when I open the project in my browser, kind of confusing to see different errors in the browser and the terminal though, but this might be more of a me problem. I do see the same as you when I run the example project with a bad config.

joelgallant commented 3 years ago

Let's keep this issue open - there's probably metadata we can attach to these errors so that that plugin shows them better.

joelgallant commented 3 years ago

@johnb8 is this still confusing, with our changes in 2.3? I think the errors should be nicer now

johnb8 commented 3 years ago

Nope, seems to be fixed. Thanks!