Add support for experimental authInterrupts in nextjs #32093
AndyClausen
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
I'm unable to use
authInterrupts
features likeunauthorized()
andforbidden()
. Even if I mock the function that uses them, the whole file is "tainted" because it importsunauthorized
fromnext/navigation
, which throws an error because it doesn't exist in storybook's version of that module.Describe the solution you'd like
I'm not sure what the best approach is here. I understand that supporting experimental features only available in canary builds is not really at the top of the list, or even a good idea, but being unable to run storybook because of a technically unused import in a mocked server action is also not great. Maybe there is a way to support this without having to implement
authInterrupts
fully?Describe alternatives you've considered
There may be a workaround for this that someone smarter than me can figure out. I don't know much about storybook or how they implement nextjs navigation, but I imagine there could be a way to get around this issue without changing storybook's code.
Are you able to assist to bring the feature to reality?
no
Additional context
A few docs links to read about
authInterrupts
:https://nextjs.org/docs/app/api-reference/config/next-config-js/authInterrupts
https://nextjs.org/docs/app/api-reference/functions/forbidden
https://nextjs.org/docs/app/api-reference/functions/unauthorized
Beta Was this translation helpful? Give feedback.
All reactions