-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Vite dev server crashes with appType mpa on root URI #10966
Comments
For a quick solution, maybe we should allow |
Error:
Looks like it's failing at: if(rewriteTarget.charAt(0) !== '/') {
logger(
'We recommend using an absolute path for the rewrite target.',
'Received a non-absolute rewrite target',
rewriteTarget,
'for URL',
req.url
);
}
logger('Rewriting', req.method, req.url, 'to', rewriteTarget);
req.url = rewriteTarget;
return next(); We could return vite/packages/vite/src/node/server/middlewares/htmlFallback.ts Lines 24 to 26 in 0d73473
|
Hello @wolfgangwalther. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it! |
* fix(config): exclude config.assetsInclude empty array (#10941) fixes #10926 * feat(css): upgrade postcss-modules (#10987) * fix(mpa): support mpa fallback (#10985) fixes #10966 * fix: export preprocessCSS in CJS (#11067) * chore: update license Co-authored-by: sun0day <sun_day500@163.com> Co-authored-by: Jason Quense <monastic.panic@gmail.com> Co-authored-by: sun0day <ivan.xu@applovin.com>
Describe the bug
Using
appType: mpa
without a<root>/index.html
file will crash when requesting/
instead of returning 404.See #10336 (comment) for the change that introduced this.
Reproduction
https://stackblitz.com/edit/vitejs-vite-t9a2jr?file=vite.config.js
Steps to reproduce
Run the dev server and request
/
.System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: