Redwood: Add support for `yarn rw dev --port 8080`

Created on 24 Jul 2020  路  6Comments  路  Source: redwoodjs/redwood

In order for vercel dev to proxy to rw, it needs to pass a port.

Ideally this could be a --port flag or it could also use a PORT environment variable.

The flag would need to have precedence over the port defined in redwood.toml, otherwise it will never work since create-redwood-app generates a redwood.toml.

kinimprovement cli

Most helpful comment

@styfle my bad! 馃槄 Nice to meet you and thank you for answering my questions!

All 6 comments

Hey @styfle, cool to see that you're using Vercel! We're trying to make Redwood seamless with more deploy targets, Vercel included.

Does vercel dev use rw dev under the hood? Basically, vercel dev can't read from the toml at all is what you're saying right?

Does vercel dev use rw dev under the hood

Yes

Basically, vercel dev can't read from the toml at all is what you're saying right?

The problem is that vercel dev creates an ephemeral port, for example 50123, and passes that to the framework's cli yarn rw dev --port 50123. Then it waits until it detects the port is in use before prompting the user that they can start developing.

Here's a quick fix: #891

This is easier than implementing a new --port flag and will solve the problem for vercel dev.

Thanks @styfle! @peterp @thedavidprice How do you feel about the fix in #891? I think we had some plans for Vercel integration and wasn't sure of the details.

@styfle @jtoar
Dom, it's a pleasure to introduce you to Steven, who works at Vercel and has been helping with the heavy lifting for Redwood deployment support! (And apologies I didn't make this introduction earlier, but greatly appreciate you both helping on this.)

I've followed up on the PR. I think I'm leaning to add the Yargs option and could try to help this weekend, but I'm deferring to Peter.

@styfle my bad! 馃槄 Nice to meet you and thank you for answering my questions!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zwl1619 picture zwl1619  路  3Comments

jeliasson picture jeliasson  路  3Comments

Tobbe picture Tobbe  路  4Comments

weaversam8 picture weaversam8  路  4Comments

hemildesai picture hemildesai  路  4Comments