Sub-app not working when mounted on "/"
See original GitHub issueI was trying to mount a sub-app on the root (“/”) but it was throwing an error:
/node_modules/polka/index.js:95
let loop = _ => res.finished || (i < len) && arr[i++](req, res, next);
^
TypeError: arr[(i++)] is not a function
I tracked the error back to the .use()
function of polka:
use(base, ...fns) {
if (typeof base === 'function') {
this.wares = this.wares.concat(base, fns);
// SUB-APP IS NOT HANDLED WELL BECAUSE OF THIS CONDITIONAL:
} else if (base === '/') {
this.wares = this.wares.concat(fns);
} else {
base = lead(base);
fns.forEach(fn => {
if (fn instanceof Polka) {
this.apps[base] = fn;
} else { ... etc ....
I have been trying to find a temporary fix without succes. Or is there another way to go about this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
django makemigration throw error on sub app - Stack Overflow
If an application is nested and can not be imported from the Python ... The name "testing" seems very general and it could...
Read more >Sub Applications - Mounts - FastAPI
"Mounting" means adding a completely "independent" application in a specific ... because the browser will be able to talk to each specific app...
Read more >Hooks - Fiber
OnMount is a hook to execute user function after mounting process. The mount event is fired when sub-app is mounted on a parent...
Read more >FAQ - qiankun - UmiJS
Solution 2: The micro-app is not bundle with umd , directly mount the life ... Try to set the webpack output.library of the...
Read more >Express.js Mount Event - GeeksforGeeks
The mount event is fired on a sub-app when it is mounted on a ... Return Value: Since its an event so it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Available with
polka@1.0.0-next.7
vianpm install polka@next
👍I, too, am having this same problem exactly.