-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: Webpack dev server config before and after middleware and renderExample path #3110
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
Conversation
|
|
@mylesmmurphy hey there! thanks for this! we are in the midst of overhauling build tooling and it looks like this example was broken |
|
Hmm, seems to cause the exact same error I get when I make this change - something about it breaks the cypress build |
thomasheyenbrock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mylesmmurphy 🙌 the main workflow for developing GraphiQL is indeed broken at the moment. Just a nit.
|
@acao Good catch, my apologies, I forgot to check that. I reworked this PR slightly and everything appears to be working correctly now :) |
acao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets get netlify deploy preview builds working before merging, the current failure is the same across all PRs
|
also to note - here the webpack NODE_ENV=development build is working for the cypress suite, but the NODE_ENV=production build we do for netlify is what is failing. |
|
I found the source of the netlify issue, this is good to merge as is! thanks for the fix. |

Current Behavior:
Upon a fresh pull and install of the project and following the dev setup instructions for GraphiQL only, you will receive the following error when trying to run
yarn run start-graphiql:Webpack deprecated v4's
devServer.beforein v5.After resolving that error, the graphiql interface does not load when opening
http://localhost:8080/orhttp://localhost:8080/dev.html, and instead hangs on the "Loading..." screen, with the error:Desired Behavior:
start-graphiqlshould start a webpack development server with the correct middlewares and no errors. You should be able to navigate to graphiql ui viahttp://localhost:8080/dev.htmlSolution:
Following webpack dev server's documentation for setting up middlewares, we should use the
setupMiddlewaresin place ofbeforeandafter.Added
/resourcestorenderExamples.jspath in Express.Notes:
We could use
onBeforeSetupMiddlewareandonAfterSetupMiddlewareinstead of the newersetupMiddlewares, which behaves closer to the original behavior than what is in this PR, but that has a deprecation warning.