Skip to content
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

fix: missing handler in server middleware #344

Merged
merged 1 commit into from Nov 24, 2021

Conversation

tobiasdiez
Copy link
Collaborator

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

In the context of building storybook in bridge, I got an empty server middleware object for some reason (not sure why). This then lead to _handler being undefined and thus app.use throws an error.
As a quick fix, I've added an if check to test if _handler is defined before calling app.use.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

@tobiasdiez tobiasdiez mentioned this pull request Nov 17, 2021
38 tasks
@farnabaz farnabaz changed the title Handle empty middleware more gracefully fix: handle missing handler in server middleware Nov 24, 2021
@farnabaz farnabaz changed the title fix: handle missing handler in server middleware fix: missing handler in server middleware Nov 24, 2021
@farnabaz farnabaz merged commit 73c5a7a into nuxt-modules:master Nov 24, 2021
@tobiasdiez tobiasdiez deleted the patch-1 branch November 25, 2021 10:42
@farnabaz farnabaz mentioned this pull request Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants