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] Internal server error: The request url "/api" is outside of vite dev server root #1420
Comments
There are a couple of issues opened directly on the Vite repo currently that all seem to be about this. There's one PR vitejs/vite#3350 open for it that I have not looked at. In the meantime, we're considering pinning Kit to Vite 2.2. edit: It sounds like that's just for fixing an issue on Windows. There are other cross-platform issues present that have issues on Vite's tracker, which are probably all different facets of the same thing. |
I tried several cases and renaming the endpoint from index.ts to index.json.ts and calling fetch("/api.json") solved the issue for me. |
that check has been disabled by default in vite 2.3.1, so if you are seeing this issue, please update |
Btw, it looks like that |
Hmm, maybe something is wrong with my setup, but I still see this error (in development). I also tried to add
|
I can't reproduce with the latest version, no errors are being logged in the console anymore. |
Describe the bug
After updating to Vite v2.3.0 I receive the following error:
[vite] Internal server error: The request url "/api" is outside of vite dev server root "/tmp/bug". For security concerns, accessing files outside of workspace root is restricted since Vite v2.3.x. Refer to docs https://vitejs.dev/config/#server-fsserveroot for configurations and more details.
To Reproduce
run server
npm run dev
navigate browser to http://localhost:3000/bugobserve error on the console
Expected behavior
not having such error
The text was updated successfully, but these errors were encountered: