Hi everyone,
I am facing a problem when I deploy my website. I am using an Astro action to send an email in hybrid output using the @astrojs/node adapter in standalone mode.
Everything works locally: the email is sent and I am redirected on success.
But when I test my website in production I get this error in the log:
13:34:16 [ERROR] [@astrojs/node] Could not render /_actions/mail.send
TypeError: Failed to parse URL from https, https://website.tld:443/_actions/mail.send
...
[cause]: TypeError: Invalid URL
at new URL (node:internal/url:797:36)
at new Request (node:internal/deps/undici/undici:9269:25)
at NodeApp.createRequest (file:///home/user/website.tld/dist/server/chunks/_@astrojs-ssr-adapter_D3rHPTjV.mjs:1098:21)
...
at SendStream.emit (node:events:519:28)
at SendStream.error (/home/user/website.tld/node_modules/send/index.js:270:17)
at SendStream.onStatError (/home/user/website.tld/node_modules/send/index.js:417:12)
at onstat (/home/user/website.tld/node_modules/send/index.js:721:26) {
code: 'ERR_INVALID_URL',
input: 'https, https://website.tld:443/_actions/mail.send'
}
}
From what I understand in this log is that the req.url is https, https://website.tld:443/_actions/mail.send which breaks the URL constructor in the adapter code
I do not see from where is the protocol preprended.
The app is running using a node application setup based on phusion passenger on my host service provider.
Node version is 20.17.0
I searched already and tried many things, but I am out of ideas now...
Thanks in anticipate for any help or hints !
Have a nice day