-
Notifications
You must be signed in to change notification settings - Fork 78
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
Support string only serverMiddleware notation #303
Comments
Just react to the original report with a 👍 emoji. Keeps down noise and enables others to filter issues by the amount of reactions. |
I noticed another issue related to this today. The serverMiddleware I have is setup to redirect any URI's that don't have a trailing slash on them to the same URI but with a trailing slash. This is useful in Nuxt, but breaks storybook. So, either I need a way to disable this serverMiddlewere when it's used in Storybook, or a better way to do a redirect of all routes. Is it weird if Storybook word like this:
|
@drewbaker I have a very similar use-case. We run a site with multiple languages and we redirect you to the right language. This is very handy for browser language detection – but it actually breaks storybook. Btw I use this workaround to solve the issue in the meantime:
And Storybook gets started with the ENV: |
@drewbaker Thank you, I had an |
Version
@nuxtjs/storybook: v4.1.1
nuxt: v2.15.7
Steps to reproduce
Use a string only serverMiddleware notation like
What is Expected?
Storybook starts fine, loading the server middleware.
What is actually happening?
Storybook crashes.
Workaround
Use the object notation:
Requested fix
Support the string only notation.
Nuxt's server works like this: https://github.com/nuxt/nuxt.js/blob/356de80e7de928958865584c083cd4551c30e875/packages/server/src/server.js#L199
In case of a function it is
require
d, which itself callsnormalize
again.The text was updated successfully, but these errors were encountered: