Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Open port authority timeout to be configurable #1007

Open
@bcharbonnier

Description

@bcharbonnier

Is your feature request related to a problem? Please describe.

When using the dev mode in slow environment (ie inside docker with watch via Volumes) it's quite frequent to have a cumulative compile time to be longer than the 5000 hardcoded timeout.
Then everything is build, but timeout kicks in, an thus we never goes in the piece of code in charge of live reload via EventSource. (It always goes to the catch)

sapper/src/api/dev.ts

Lines 249 to 272 in b1c4585

ports.wait(this.port)
.then((() => {
this.emit('ready', <ReadyEvent>{
port: this.port,
process: this.proc
});
if (this.hot && this.bundler === 'webpack') {
this.dev_server.send({
status: 'completed'
});
} else if (this.live) {
this.dev_server.send({
action: 'reload'
});
}
}))
.catch(err => {
if (this.crashed) return;
this.emit('fatal', <FatalEvent>{
message: `Server is not listening on port ${this.port}`
});
});

Describe the solution you'd like

I'd like to increase the timeout via a parameter in configuration because I am aware my env is not super fast, and I'd like to give it some more time.


Additional context

I found it weird also that when the port checking is failing, it goes to catch, hence displaying the _ Server is not listening on port ... _ message even though everything has been started, and everything is working.

So maybe this issue should be one on port authority. Description of the underlying behaviour looks like PA is not working properly in the end...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions