Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Issues with running Remix and code-server #7025

Answered by MinskLeo
MinskLeo asked this question in Q&A
Discussion options

Hi everyone! Help really wanted :( I have a self-hosted code-server instance and I want to run remix app inside of it. When app starts, code-server also starts port forwarding for particular port, so that application can be available outside of the container.

Example:
code-server deployed location: https://codeserver.somedomain.com/
proxied location (remix app): https://codeserver.somedomain.com/proxy/5173

But when i get into the app through the proxy (https://codeserver.somedomain.com/proxy/5173) the app can't actually resolve correctly resources. We can clearly see on network tab in devtools that all of them missing that proxy part, basically requesting resources from root of domain. For example root.tsx file will be requested from https://codeserver.somedomain.com/app/root.tsx, not https://codeserver.somedomain.com/proxy/5173/app/root.tsx. I was thinking about changing basename, but after playing around with base and basename in remix and vite configurations I wasn't able to successfully load resources...

Also I made a new discussion in remix repo, but I don't think there will be any guys who can help with that:
remix-run/remix#10050

If anyone have any suggestion or have experience with resolving that, your response will be highly appreciated!

You must be logged in to vote

The question was answered here #6212. The solution is proper absproxy usage. I missunderstood what does mean and what is expected usage of absproxy. Anyway, thats the solution I made:

vite.config.ts

import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
 base: '/absproxy/5173/',
 plugins: [
 remix({
 basename: '/absproxy/5173/',
 future: {
 v3_fetcherPersist: true,
 v3_relativeSplatPath: true,
 v3_throwAbortReason: true,
 },
 }),
 tsconfigPaths(),
 ],
});

Replies: 1 comment 1 reply

Comment options

The question was answered here #6212. The solution is proper absproxy usage. I missunderstood what does mean and what is expected usage of absproxy. Anyway, thats the solution I made:

vite.config.ts

import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
 base: '/absproxy/5173/',
 plugins: [
 remix({
 basename: '/absproxy/5173/',
 future: {
 v3_fetcherPersist: true,
 v3_relativeSplatPath: true,
 v3_throwAbortReason: true,
 },
 }),
 tsconfigPaths(),
 ],
});
You must be logged in to vote
1 reply
Comment options

Sorry for the delayed response, but glad you got it sorted! If you think of any way we can clear up absproxy in the documentation, do let me know, it is definitely confusing I think.

Answer selected by MinskLeo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /