Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct port in with-zones example #3679

Merged
merged 1 commit into from
Feb 5, 2018

Conversation

tomaswitek
Copy link
Contributor

According to proxy rules the blog app should start on port 5000:

{
  "rules": [
    {"pathname": "/blog", "method":["GET", "POST", "OPTIONS"], "dest": "http://localhost:5000"},
    {"pathname": "/**", "dest": "http://localhost:4000"}
  ]
}

@timneutkens
Copy link
Member

Awesome 🙏

@timneutkens timneutkens merged commit 9498fc6 into vercel:canary Feb 5, 2018
@jmaguirrei
Copy link
Contributor

Hi, I am having this error after installing with-zones example.

Home and Blog are running in the correct port, but proxy fails.

Is this working for you?

Thanks

`
Joses-MacBook-Air:with-zones jmaguirrei$ npm run proxy

with-zones@1.0.0 proxy /Users/jmaguirrei/Downloads/next/examples/with-zones
micro-proxy -r rules-dev.json

/Users/jmaguirrei/Downloads/next/examples/with-zones/node_modules/micro-proxy/index.js:113
...req.headers,
^^^

SyntaxError: Unexpected token ...
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:533:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (/Users/jmaguirrei/Downloads/next/examples/with-zones/node_modules/micro-proxy/bin/micro-proxy:3:20)

npm ERR! Darwin 17.4.0
npm ERR! argv "/usr/local/Cellar/node/8.0.0_1/bin/node" "/usr/local/bin/npm" "run" "proxy"
npm ERR! node v8.0.0
npm ERR! npm v4.0.0
npm ERR! code ELIFECYCLE
npm ERR! with-zones@1.0.0 proxy: micro-proxy -r rules-dev.json
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the with-zones@1.0.0 proxy script 'micro-proxy -r rules-dev.json'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the with-zones package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! micro-proxy -r rules-dev.json
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs with-zones
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls with-zones
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/jmaguirrei/Downloads/next/examples/with-zones/npm-debug.log
`

@timneutkens
Copy link
Member

@jmaguirrei related to you being on a node version under 9. Will be fixed when https://github.com/zeit/micro-proxy/pull/19 lands

@jmaguirrei
Copy link
Contributor

@timneutkens Thanks, I upgraded to node v9.5.0, deployed the example to zeit/now and seems to work ok !

I added this in all package.json (and log process.version to confirm is v9.5.0):
"engines": { "node": "9.5.0" },

I am planning to do this in production, is there any downside with this approach?
Link, prefetch, routing should be OK?

@lock lock bot locked as resolved and limited conversation to collaborators Feb 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants