Closed ovenum closed 2 years ago
Could you provide a minimal reproducible example with your code, please?
A repo would be just fine. Thanks in advance!
Sure it’s pretty bare-bones: https://github.com/basics09/kirbyup-issue-22/ : )
Looking at line 3429 in node_modules/kirbyup/dist/shared/kirbyup.1b72ea0c.mjs
the issue is emitted from inside configureServer().
The address property of server.httpServer.address() is ::1
when i try to run the script.
Editing the file and replacing it with the IPv4 loopback address will run the script but of course HMR will not work since the server was configured with the IPv6 loopback address.
This probably boils down to node URL in v18.6.0 not handling IPv6 correctly?
After upgrading to node v18.8.0 i found the issue.
IPv6 addresses inside a URL have to be enclosed in square brackets [ ]
as by the RFC Spec
configureServer should maybe try to detect if a IPv4 or IPv6 address is used. Not that deep into node, maybe httpServer.address() does this somewhere already? After that baseUrl can be build with IPv6 addresses working correctly.
Currently baseUrl will be something like this http://::1:5177/
but should be http://[::1]:5177
for IPv6 Urls.
@basics09 fixed by @jonaskuske. Thank you both!
Fix will land in kirbyup v2.0.1.
Thanks for this great tool @johannschopplich!
Currently running into an error when trying to start kirbyup with the new HMR feature.
Starting kirbyup from within a plugin with
kirbyup serve src/index.js
will result in this error message. There is no custom config applied. This is on macOS 12.3.1 and using node v18.6.0.