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
I'm using a code-server cloud environment to develop a SvelteKit project. In order to access the dev server, a proxy is provided that uses a subpath to proxy the dev server port (see docs). This leads me to need a base path to be set for the dev server.
If I set a base path as stated in the documentation, the first page load works correctly but the import statements on the rendered page are relative to the root. These return a 404, correctly, because those files are not available without the proxy.
Expected behavior
All paths in the dev server reference the base path instead of being relative to the root domain. If necessary, the dev server strips the base path to find the dev server files.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
Since I ran into the same issue with Svelte-Kit, I don't quite understand why you believe that this is a Vite problem.
With the following vite.config.ts in a Vanilla-TS Vite (v2.7.2) project, everything works like I would expect it:
No, agreed, I must have been doing something wrong before. This doesn't seem to be a Vite issue. I'm fairly new to Vite and I must have configured something incorrectly before. I am seeing the behavior work correctly in a vanilla Vite project.
Describe the bug
I'm using a code-server cloud environment to develop a SvelteKit project. In order to access the dev server, a proxy is provided that uses a subpath to proxy the dev server port (see docs). This leads me to need a base path to be set for the dev server.
If I set a base path as stated in the documentation, the first page load works correctly but the import statements on the rendered page are relative to the root. These return a 404, correctly, because those files are not available without the proxy.
Related to sveltejs/kit#2958
Expected behavior
All paths in the dev server reference the base path instead of being relative to the root domain. If necessary, the dev server strips the base path to find the dev server files.
Reproduction
System Info
System: OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa) CPU: (12) x64 Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz Memory: 560.98 MB / 15.32 GB Container: Yes Shell: Unknown - /bin/false Binaries: Node: 14.18.2 - /usr/bin/node Yarn: 1.22.15 - /usr/bin/yarn npm: 6.14.15 - /usr/bin/npm npmPackages: vite: ^2.6.14 => 2.6.14
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: