Setting HOST environment variable with anything other than a legitimate host prevents the server from running
See original GitHub issueWhat version of Remix are you using?
1.4.0
Steps to Reproduce
- Set
HOST
envrionment variable to anything that is an invalid hostname. An example:http://localhost:3000
- Run the server
Expected Behavior
The server to run as usual.
Actual Behavior
Error: getaddrinfo ENOTFOUND http://localhost:3000
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'http://localhost:3000'
}
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Environment Variables: What They Are and How To Use Them
While you can assign a value to an environment variable manually by using the SET command or its equivalent, you can not assign...
Read more >Publish to IIS, setting Environment Variable - Stack Overflow
Go to your application in IIS and choose Configuration Editor . · Select Configuration Editor · Choose system. · Choose Applicationhost. · Right...
Read more >Working with Environment Variables in Node.js - Twilio
js application. So while hosts will set a PORT variable that specifies on which port the server should listen to, modules might have...
Read more >How to Set, List and Manage Linux Environment Variables
By convention, but not rule, environment variable names are always capitalized. Shell variables are not the same as environment variables. Shell ...
Read more >Environment Variables in Next.js - Frontend Digest
js in production. I wanted to get it right from the beginning. This is what I learned. Let's see how we can set...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Following up on @ElMatella’s comment, I’m trying to get a basic Remix app working with the new Shopify v3.0 CLI.
After moving the standard Remix template beneath a ‘web’ subdirectory (as detailed at: https://shopify.dev/apps/tools/cli/migrate#step-1-migrate-your-embedded-app), and adding the
process.env.HOST
change toremix.config.js
identified by @ElMatella, I also had to change theshopify.web.toml
file that was in the./web
folder to betype="frontend"
instead oftype="backend"
.The
yarn dev
command from the root folder then worked for calling the v3.0 CLIshopify app dev
command and doing the ngrok setup to expose the Remix app with the correct port. 🚀I’m in the process of porting this starter app (https://github.com/WillsonSmith/shopify-remix-app) over to match the default Shopify node app template (in terms of functionality), and will then add to GitHub. Hopefully can make it a Remix stack as well!
Hey, I’m running on the exact same problem as @TheRealFlyingCoder while building a Shopify APP.
The shopify CLI rewrites the
HOST
variable into the.env
file when running with an ngrok generated URL. I’m not saying that this is a good move from the shopify team. However, it could be cool if we could just add a parameter intoremix.config.js
to override this environment variable like:This way, we could keep the current way of how it’s working while enabling to use a different value than the HOST environment variable.
Currently, the workaround I found was to overwrite the
process.env.HOST
variable directly intoremix.config.js
: