ERR_INVALID_URL
I get this Error:
snapp_1 | 678 | var ssr = function(request) {
snapp_1 | 679 | if (origin) {
snapp_1 | 680 | const requestOrigin = get_origin(request.headers);
snapp_1 | 681 | if (origin !== requestOrigin) {
snapp_1 | 682 | request = new Request(origin + url, {
snapp_1 | ^
snapp_1 | TypeError: Failed to construct 'Request': Invalid URL "sub.domain.tld/"
snapp_1 | code: "ERR_INVALID_URL"
snapp_1 |
snapp_1 | at ssr (/app/build/handler.js:682:17)
And i have absolutely no clue how to fix it, can anyone here help? (I replaced the domain in the code) I'm using docker, with this compose file:
services:
snapp:
image: uraniadev/snapp:latest
ports:
- 5999:3000
environment:
ORIGIN: sub.domain.tld
PUBLIC_URL: https://sub.domain.tld
DATABASE_PROVIDER: sqlite
DATABASE_URL: file:./db.sqlite
TOKEN_SECRET: myextremlytopsecretkeyisobviouslyreplacedxD
ADMIN_EMAIL: [email protected]
ADMIN_PASSWORD: mypasswordisreplaced
Have you tried http://sub.domain.tld?
Yup, same error :(
This is weird,
Would you check with the same origin and public URL, and rebuilding the container?
Are you behind a firewall or proxy? Have you test it like http://machine:port ?
@skyhoppertv Have you tried just sub.domain.tld without the slash at the end maybe?
As u can see in the compose.yml there is no slash there ;)
Are you behind a firewall or proxy? Have you test it like http://machine:port ?
Updates on this?
Are you behind a firewall or proxy? Have you test it like http://machine:port ?
Yup, the server connects via VPN to a VPS and there is a reverse proxy
snapp_1 | Listening on 0.0.0.0:3000
snapp_1 | 611 | return event.fetch(info, init2);
snapp_1 | 612 | },
snapp_1 | 613 | /** @param {string[]} deps */
snapp_1 | 614 | depends: (...deps) => {
snapp_1 | 615 | for (const dep of deps) {
snapp_1 | 616 | const { href } = new URL(dep, event.url);
snapp_1 | ^
snapp_1 | TypeError: "i18n" cannot be parsed as a URL.
snapp_1 | code: "ERR_INVALID_URL"
snapp_1 |
snapp_1 | at depends (/app/build/server/index.js:616:28)
snapp_1 | at <anonymous> (/app/build/server/entries/pages/_layout.server.ts.js:4:3)
snapp_1 | at load (/app/build/server/entries/pages/_layout.server.ts.js:3:14)
snapp_1 | at run (node:async_hooks:64:22)
snapp_1 | at with_event (/app/build/server/index.js:67:22)
snapp_1 | at <anonymous> (/app/build/server/index.js:604:24)
snapp_1 | at load_server_data (/app/build/server/index.js:571:32)
snapp_1 | at <anonymous> (/app/build/server/index.js:1959:35)
But now it's not "Uh oh!!" on the web page, but giving Internal Error 500
That typerror about i18n is confusing...
trying to upload 0.9-rc-019 that should address this issues on first load and homepage
thx! Will try this, when its uploaded!
Still this error:
snapp_1 | 677 | };
snapp_1 | 678 | var ssr = function(request) {
snapp_1 | 679 | if (origin) {
snapp_1 | 680 | const requestOrigin = get_origin(request.headers);
snapp_1 | 681 | if (origin !== requestOrigin) {
snapp_1 | 682 | request = new Request(origin + url, {
snapp_1 | ^
snapp_1 | TypeError: Failed to construct 'Request': Invalid URL "domain.dev/"
snapp_1 | code: "ERR_INVALID_URL"
snapp_1 |
snapp_1 | at ssr (/app/build/handler.js:682:17)
With 0.9-rc-019
And it's still "Uh oh!!" on the main page
sorry i meant, the app is reachable if you use http://machine:port?
i don't understand where the error lies, as it is sveltekit that handle that stuff, not me.
edit: from what i see the origin misses the protocol causing the error, also you set origin in docker compose (with or without protocol) but the proxy how interact with it?
I got it to work! Thanks for the help!
Wonderful, what was the error? Or has been enough to set the vars? :)
with the new version and the right vars it's working
i have the same problem, i need help with this pls
What is the setting that i need to edit,? have a Reverse Proxy with HAProxy and i have the same error
The proxy make the connection with the IP http://X.X.X.X:3030 (i change the external docker port) and latter i use the https://sub.domain.tld to connect
If i put the IP in the origin i got this error:
@zenstackhq/server: ZenStackHandler installing routes at prefix: /api
Listening on 0.0.0.0:3000
677 | };
678 | var ssr = function(request) {
679 | if (origin) {
680 | const requestOrigin = get_origin(request.headers);
682 | request = new Request(origin + url, {
681 | if (origin !== requestOrigin) {
TypeError: Failed to construct 'Request': Invalid URL "X.X.X.X:3030/"
^
code: "ERR_INVALID_URL"
at ssr (/app/build/handler.js:682:17)
services:
snapp:
image: uraniadev/snapp:latest
hostname: acortador-snapp
ports:
- 3030:3000
environment:
ORIGIN: X.X.X.X:3030
PUBLIC_URL: https://sub.domain.tld
DATABASE_PROVIDER: sqlite
DATABASE_URL: file:./db.sqlite
My first Try was with this settings:
@zenstackhq/server: ZenStackHandler installing routes at prefix: /api
Listening on 0.0.0.0:3000
677 | };
678 | var ssr = function(request) {
679 | if (origin) {
680 | const requestOrigin = get_origin(request.headers);
682 | request = new Request(origin + url, {
681 | if (origin !== requestOrigin) {
TypeError: Failed to construct 'Request': Invalid URL "**sub.domain.tld**/"
^
code: "ERR_INVALID_URL"
at ssr (/app/build/handler.js:682:17)
services:
snapp:
image: uraniadev/snapp:latest
hostname: acortador-snapp
ports:
- 3030:3000
environment:
ORIGIN: **sub.domain.tld**
PUBLIC_URL: https://sub.domain.tld
DATABASE_PROVIDER: sqlite
DATABASE_URL: file:./db.sqlite
try both PUBLIC_URL: https://sub.domain.tld ORIGIN: https://sub.domain.tld