headplane icon indicating copy to clipboard operation
headplane copied to clipboard

Bundled build requests both the /admin/ and / routes for assets.

Open MathisTLD opened this issue 6 months ago • 14 comments
trafficstars

Description

I noticed the the app fails to load a tailwind CSS stylesheet:

GET https://<my-domain>/assets/tailwind-XGsKPiOx.css net::ERR_ABORTED 404

I noticed that https://<my-domain>/admin/assets/tailwind-XGsKPiOx.css properly resolves so I think the error is just that the path prefix is ignored when trying to load the tailwind stylesheet. I checked the vite config, it seems alright to me so the error should be somewhere else.

Headplane Version

v0.5.10

Headscale Version

v0.25.1

MathisTLD avatar May 12 '25 16:05 MathisTLD

Uncaught Error: Minified React error #418; visit https://react.dev/errors/418?args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings. at bt (entry.client-CnoFeh7g.js:24:30893) at ds (entry.client-CnoFeh7g.js:24:75500) at Ks (entry.client-CnoFeh7g.js:24:115566) at Sd (entry.client-CnoFeh7g.js:24:115539) at md (entry.client-CnoFeh7g.js:24:115400) at Zs (entry.client-CnoFeh7g.js:24:111243) at Fs (entry.client-CnoFeh7g.js:24:121116) at MessagePort.Z (entry.client-CnoFeh7g.js:9:1621) tailwind-XGsKPiOx.css:1

       Failed to load resource: the server responded with a status of 404 ()

/favicon.ico:1

       Failed to load resource: the server responded with a status of 404 ()

tailwind-XGsKPiOx.css:1

       Failed to load resource: the server responded with a status of 404 ()

skarpinis avatar May 13 '25 18:05 skarpinis

This will be fixed in 0.6.0.

tale avatar May 14 '25 04:05 tale

Can you test with the ghcr.io/tale/headplane:next Docker image please? Keep in mind it requires Headscale 0.26 or higher to work.

tale avatar May 16 '25 15:05 tale

Can you test with the ghcr.io/tale/headplane:next Docker image please? Keep in mind it requires Headscale 0.26 or higher to work.

2025-05-16T18:30:37.908Z [config] ERROR: Error reading Headscale configuration file at /etc/headscale/config.yaml

2025-05-16T18:30:37.908Z [config] ERROR: Error: EISDIR: illegal operation on a directory, read

at async readFileHandle (node:internal/fs/promises:549:24)

at async loadConfigFile (file:///app/build/server/assets/index-BHw27Zg2.js:235492:18)

at async loadHeadscaleConfig (file:///app/build/server/assets/index-BHw27Zg2.js:235417:20)

at async file:///app/build/server/assets/index-BHw27Zg2.js:236236:7 {

errno: -21,

code: 'EISDIR',

syscall: 'read'

}

skarpinis avatar May 16 '25 18:05 skarpinis

Looks like you didn't pass in the configuration correctly. It's up to you to make sure your setup is correct before I can debug issues.

tale avatar May 17 '25 01:05 tale

no problem but still saw the same error as before

skarpinis avatar May 17 '25 06:05 skarpinis

Looks like you didn't pass in the configuration correctly. It's up to you to make sure your setup is correct before I can debug issues.

entry.client-iERGfG6i.js:24 Uncaught Error: Minified React error #418; visit https://react.dev/errors/418?args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings. at bt (entry.client-iERGfG6i.js:24:30893) at ds (entry.client-iERGfG6i.js:24:75500) at Ks (entry.client-iERGfG6i.js:24:115566) at Sd (entry.client-iERGfG6i.js:24:115539) at md (entry.client-iERGfG6i.js:24:115400) at Zs (entry.client-iERGfG6i.js:24:111243) at Fs (entry.client-iERGfG6i.js:24:121116) at MessagePort.Z (entry.client-iERGfG6i.js:9:1621) entry.client-iERGfG6i.js:24 GET https://my-domain/assets/tailwind-BDnc2vn7.css net::ERR_ABORTED 404 (Not Found)

skarpinis avatar May 17 '25 09:05 skarpinis

Are there issues with your reverse proxy? I cannot reproduce this.

tale avatar May 17 '25 22:05 tale

Are there issues with your reverse proxy? I cannot reproduce this.

no issues did evertyhing as in docs it works but i got this error in console.

skarpinis avatar May 18 '25 08:05 skarpinis

Can you share your reverse proxy configuration and build settings? Are you using a custom prefix?

tale avatar May 18 '25 15:05 tale

version: '3.9' services: headplane: image: ghcr.io/tale/headplane:next container_name: headplane restart: unless-stopped environment: - TZ=local volumes: - /home/user/docker/headplane/config.yaml:/etc/headplane/config.yaml - /home/user/docker/headscale/config/config.yaml:/etc/headscale/config.yaml - /home/user/docker/headplane/headplane-data:/var/lib/headplane - /var/run/docker.sock:/var/run/docker.sock:ro networks: - proxy labels: traefik.enable: true traefik.docker.network: proxy traefik.http.routers.headplane.rule: Host(mydomain) && PathPrefix(/admin) traefik.http.services.headplane.loadbalancer.server.port: 3000 traefik.http.services.headplane.loadbalancer.server.scheme: http traefik.http.routers.headplane.entrypoints: https traefik.http.routers.headplane.tls.certresolver: cloudflare

headscale: image: headscale/headscale:0.26.0 container_name: headscale restart: unless-stopped command: serve environment: - TZ=local volumes: - /home/user/docker/headscale/config:/etc/headscale/ - /home/user/docker/headscale/keys:/var/lib/headscale/ networks: - proxy labels: com.headplane.selector: headscale traefik.enable: true traefik.docker.network: proxy traefik.http.services.headscale.loadbalancer.server.port: 8080 traefik.http.services.headscale.loadbalancer.server.scheme: http traefik.http.routers.headscale.rule: Host(maydomain) traefik.http.routers.headscale.entrypoints: https traefik.http.routers.headscale.tls.certresolver: cloudflare traefik.http.routers.headscale.service: headscale traefik.http.routers.headscale-secure.middlewares: cors@file traefik.http.routers.rewrite.rule: Host(mydomain) && Path(/) traefik.http.routers.rewrite.service: headscale traefik.http.routers.rewrite-secure.middlewares: rewrite@file

networks: proxy: external: true ``

skarpinis avatar May 18 '25 22:05 skarpinis

  • http:

    routers: headscale: rule: 'Host(mydomain)' service: 'headscale' middlewares: - 'cors'

    rewrite: rule: 'Host(mydomain) && Path(/)' service: 'headscale' middlewares: - 'rewrite'

    headplane: rule: 'Host(mydomain) && PathPrefix(/admin)' service: 'headplane'

    services: headscale: loadBalancer: servers: - url: 'http://headscale:8080'

    headplane: loadBalancer: servers: - url: 'http://headplane:3000'

    middlewares: rewrite: addPrefix: prefix: '/admin' cors: headers: accessControlAllowHeaders: '*' accessControlAllowMethods: - 'GET' - 'POST' - 'PUT' accessControlAllowOriginList: - 'https://mydomain' accessControlMaxAge: 100 addVaryHeader: true

skarpinis avatar May 18 '25 22:05 skarpinis

Ok thank you, I'm able to reproduce, give me some time.

tale avatar May 20 '25 16:05 tale

I'm going to defer this issue mostly because it doesn't break the stylesheet from loading and it seems like a weird issue with the framework build that'll require quite some time to dig through.

tale avatar May 23 '25 14:05 tale

This was unintentionally fixed (not that it really was a problem to begin with), and will land with 0.6.1 which is coming soon.

tale avatar Aug 21 '25 16:08 tale