harlan-zw / unlighthouse

Scan your entire site with Google Lighthouse in 2 minutes (on average). Open source, fully configurable with minimal setup.
https://unlighthouse.dev
MIT License
3.68k stars 105 forks source link

"Not found" when running on a folder and using buildStatic #118

Closed pocesar closed 1 year ago

pocesar commented 1 year ago

Describe the bug

Everything in the bundled file uses / as the path, so it breaks when outputting to a folder, like in storage buckets. The index.html page loads with a "Not found" text only, no extra requests are made. window.__unlighthouse_payload is present though

Reproduction

No response

System / Nuxt Info

System:
    OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (6) x64 AMD Ryzen 7 5800X3D 8-Core Processor
    Memory: 14.30 GB / 15.62 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 18.16.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 9.5.1 - /usr/bin/npm
  Browsers:
    Chrome: 113.0.5672.92
harlan-zw commented 1 year ago

Hi @pocesar, you should use the routerPrefix for this I beleive. See the docs

pocesar commented 1 year ago

@harlan-zw I'm already using it, getting the same result

ghulththrw commented 1 year ago

The "Not found" seems to be caused by the vite-plugin-pages catch-all route in packages/client/pages/[...all].vue.

To reproduce visit https://vue-demo.unlighthouse.dev/index.html

As noted above and in #132 there are certain hostings where index.html is accessed directly instead of /. It would be great if unlighthouse would support this.

harlan-zw commented 1 year ago

Thanks, guys, will try and solve it soon. Currently on a different project.

PRs welcome :)

harlan-zw commented 1 year ago

The "Not found" seems to be caused by the vite-plugin-pages catch-all route in packages/client/pages/[...all].vue.

To reproduce visit vue-demo.unlighthouse.dev/index.html

As noted above and in #132 there are certain hostings where index.html is accessed directly instead of /. It would be great if unlighthouse would support this.

This was helpful, thanks again!

The vue-router plugin has been removed which fixes this issue, available in 0.9.0. Let me know if you have any issues with it.