tot-ra / graphql-schema-registry

GraphQL schema registry
MIT License
372 stars 68 forks source link

UI requesting non-existant `__webpack_hmr` endpoint #95

Closed jon-frankel closed 2 years ago

jon-frankel commented 2 years ago

I have found the UI repeatedly requesting this endpoint: http://localhost:6001/__webpack_hmr

Screen Shot 2022-01-10 at 4 26 55 PM

It appears to be a configuration issue in webpack.config.js in createConfigDev, as mentioned in this StackOverflow question/answer.

tot-ra commented 2 years ago

That may be a leftover from react/webpack hot reload, I'm not sure 🤔

ehardy commented 2 years ago

Yes, this is indeed related to react/webpack hot reloading if my memory serves me well. If you set the NODE_ENV environment variable to production, the web assets should be served from their compiled version and this error should disappear. There's a note to that effect in the README under the NODE_ENV variable documentation.

jon-frankel commented 2 years ago

@ehardy That fixed it, thank you!

jon-frankel commented 2 years ago

Oops, I spoke too soon, sorry. This is still happening, even with NODE_ENV set to production. Would it be safe to remove that line from the config options?

ehardy commented 2 years ago

Hmm, that's weird. According to the logic in assets.js, webpack is only loaded when the NODE_ENV is set to anything but production. See here.

I would say to check your startup logs. If you see anything related to webpack-hot-middleware, that means that webpack is enabled and that your NODE_ENV is not set properly. I tested back and forth, and I only see the webpack 404 requests when NODE_ENV is not set to production.

jon-frankel commented 2 years ago

Sorry for the late reply. I can confirm that NODE_ENV is set to production and this is still happening. Since this doesn't affect core functionality, I don't think I'll be able to spend time investigating further, unfortunately.

tot-ra commented 2 years ago

removed dev config, you can try that https://github.com/pipedrive/graphql-schema-registry/pull/99/files