You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have earlier module call it with an async function
What is Expected?
The second module receives a list of extended routes.
What is actually happening?
Error: routes.push is not a function.
The second module crashes on trying to modify routes as it receives a promise rather than an array.
Additional info
chainFn used by extendRoutes doesn't resolve chained functions so if one of the modules uses async function then it will pass unresolved promise to the next module.
It happens to work if there is only one module using extendRoutes and passing async function to it as then it's awaited by the code that triggers chained functions in the first place.
The text was updated successfully, but these errors were encountered:
I have a workaround for nuxt-i18n (using CommonJS require rather than ESImports) and I won't be switching back to the old way as that wouldn't be compatible with older versions.
Versions
Reproduction
https://github.com/rchl/nuxt-issue-extendRoutes-async
Steps to reproduce
this.extendRoutes
What is Expected?
The second module receives a list of extended routes.
What is actually happening?
Error:
routes.push is not a function
.The second module crashes on trying to modify routes as it receives a promise rather than an array.
Additional info
chainFn used by
extendRoutes
doesn't resolve chained functions so if one of the modules uses async function then it will pass unresolved promise to the next module.It happens to work if there is only one module using
extendRoutes
and passing async function to it as then it's awaited by the code that triggers chained functions in the first place.The text was updated successfully, but these errors were encountered: