Closed mathieucivel closed 4 years ago
v0.5.10
https://jsfiddle.net/Lqrzf41m/
I'm just using the module, in a empty nuxtServerInit action.
nuxtServerInit
My baseURL is http://localhost:8081
async nuxtServerInit({ commit }, context) { try { const libs = await context.$http.$get('/api/libs/') commit('setLibs', libs) } catch (error) { console.error(error) } }
this.$http to use a valid baseURL.
this.$http
ERROR request to http://localhost81/api/libs/ failed, reason: getaddrinfo ENOTFOUND localhost81
Looks like this line causes the issue : https://github.com/nuxt/http/blob/dev/lib/module.js#L119https://github.com/nuxt/http/blob/dev/lib/module.js#L119
Manualy setting http.baseURL in nuxt config produces the same error.
Use a port not starting by 80
80
Version
v0.5.10
Reproduction link
https://jsfiddle.net/Lqrzf41m/
Steps to reproduce
I'm just using the module, in a empty
nuxtServerInit
action.My baseURL is http://localhost:8081
What is expected ?
this.$http
to use a valid baseURL.What is actually happening?
ERROR request to http://localhost81/api/libs/ failed, reason: getaddrinfo ENOTFOUND localhost81
Additional comments?
Looks like this line causes the issue : https://github.com/nuxt/http/blob/dev/lib/module.js#L119https://github.com/nuxt/http/blob/dev/lib/module.js#L119
Manualy setting http.baseURL in nuxt config produces the same error.
Workaround
Use a port not starting by
80