cohenerickson / Velocity

Velocity is a fully featured tabbed proxy with a seamless browsing experience.
https://velocity.radon.games
GNU Affero General Public License v3.0
132 stars 301 forks source link

[Bug]: Issues Static Hosting #38

Open Notplayingallday383 opened 11 months ago

Notplayingallday383 commented 11 months ago

What Happened

So after following the guide you send in #27 It didnt work and its blank even though in the network logs it says the assets are loaded correctly. image THe only error is from the manifest for some reason since im trying to embed it into a website and its for some reason loading the other manifest instead of velocitys.

Expected Behavior

For the Velocity UI to appear and work.

Steps to Reproduce

In the folder of this github repo run `npm run build` then copy the files from the dist folder to a static host then from there you will see the issues such as the screen just being white.

Other Information

Windows 11 x64 22H2

Checklist

cohenerickson commented 11 months ago

There is a weird issue with SolidJS that breaks when you go to /index.html, try using http://localhost:6969/velocity/ instead

Notplayingallday383 commented 11 months ago

alright ill try that

Notplayingallday383 commented 11 months ago

Alright I tried it and its still not working image

cohenerickson commented 11 months ago

I think its something to do with the /velocity directory, I get the same thing when hosting on a nested dir using live-server (vsc ext)

This is likey a side product of SolidStart, ill see if there is anything I can do about it

image

cohenerickson commented 11 months ago

I think this can be fixed with the vite config base property, it should change the import paths to whatever your prefix is

https://vitejs.dev/config/shared-options.html#base

Notplayingallday383 commented 11 months ago

I think this can be fixed with the vite config base property, it should change the import paths to whatever your prefix is

https://vitejs.dev/config/shared-options.html#base

So how would I do this? I tried seting the in the index.html and it didnt do anything. I read the guide and I couldn't find any files named vite-env config. image however even though the assets are loading now after changing some of the asset links from /assets/ to assets/ however now its giving me a new error: image

Notplayingallday383 commented 11 months ago

Hey its been a while since theres been an update but I created a vite.config.js and imported it into the html and it didnt do anything do you know where the vite config is?

cohenerickson commented 11 months ago

You will have to rebuild the code after modifying the configuration file in the root of the repo

Notplayingallday383 commented 11 months ago

You will have to rebuild the code after modifying the configuration file in the root of the repo

Alright so I added the base thing to the vite.config.js then ran npm run build and it seems to have fixed a ton of asset loading issues but its still blank. image Also heres the vite config in case I did this wrong:

import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
import solid from "solid-start/vite";
import { defineConfig } from "vite";
import { viteStaticCopy } from "vite-plugin-static-copy";

export default defineConfig({
  base: "/velocity/",
  plugins: [
    viteStaticCopy({
      targets: [
        {
          src: `${uvPath}/.`.replace(/\\/g, "/"),
          dest: "uv",
        },
        {
          src: "public/uv/uv.config.js",
          dest: "uv",
        },
        {
          src: "./out/.",
          dest: "addon",
        },
      ],
    }),
    solid({ ssr: false }),
  ],
  server: {
    proxy: {
      "^/bare/*": {
        rewrite: (path: string) => path.replace(/^\/bare/, ""),
        target: "http://localhost:8080/",
        ws: true,
      },
    },
  },
});
VelocitasNet commented 8 months ago

You will have to rebuild the code after modifying the configuration file in the root of the repo

Alright so I added the base thing to the vite.config.js then ran npm run build and it seems to have fixed a ton of asset loading issues but its still blank. image Also heres the vite config in case I did this wrong:

import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
import solid from "solid-start/vite";
import { defineConfig } from "vite";
import { viteStaticCopy } from "vite-plugin-static-copy";

export default defineConfig({
  base: "/velocity/",
  plugins: [
    viteStaticCopy({
      targets: [
        {
          src: `${uvPath}/.`.replace(/\\/g, "/"),
          dest: "uv",
        },
        {
          src: "public/uv/uv.config.js",
          dest: "uv",
        },
        {
          src: "./out/.",
          dest: "addon",
        },
      ],
    }),
    solid({ ssr: false }),
  ],
  server: {
    proxy: {
      "^/bare/*": {
        rewrite: (path: string) => path.replace(/^\/bare/, ""),
        target: "http://localhost:8080/",
        ws: true,
      },
    },
  },
});

did you have to create your own index.html also? I tried a fresh install and i get redirected to localhost:3000 index.html not found. even on github i do not see a index.html. can you please help me :)