Skip to content
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

[Bug]: Issues Static Hosting #38

Open
1 task done
Notplayingallday383 opened this issue Jul 23, 2023 · 10 comments
Open
1 task done

[Bug]: Issues Static Hosting #38

Notplayingallday383 opened this issue Jul 23, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@Notplayingallday383
Copy link

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

  • I have read and followed the contributing guidelines
@Notplayingallday383 Notplayingallday383 added the bug Something isn't working label Jul 23, 2023
@cohenerickson
Copy link
Owner

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

@Notplayingallday383
Copy link
Author

alright ill try that

@Notplayingallday383
Copy link
Author

Alright I tried it and its still not working
image

@cohenerickson
Copy link
Owner

cohenerickson commented Jul 24, 2023

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

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

@Notplayingallday383
Copy link
Author

Notplayingallday383 commented Aug 1, 2023

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
Copy link

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants