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

BaseURL incorrectly modified : ENOTFOUND localhost81 #120

Closed
mathieucivel opened this issue Aug 8, 2020 · 0 comments · Fixed by #124
Closed

BaseURL incorrectly modified : ENOTFOUND localhost81 #120

mathieucivel opened this issue Aug 8, 2020 · 0 comments · Fixed by #124
Labels
bug Something isn't working

Comments

@mathieucivel
Copy link

mathieucivel commented Aug 8, 2020

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

async nuxtServerInit({ commit }, context) {
    try {
      const libs = await context.$http.$get('/api/libs/')
      commit('setLibs', libs)
    } catch (error) {
      console.error(error)
    }
}

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

@ghost ghost added the cmty:bug-report label Aug 8, 2020
@mathieucivel mathieucivel changed the title BaseURL incorectly modified : ENOTFOUND localhost81 BaseURL incorrectly modified : ENOTFOUND localhost81 Aug 8, 2020
@atinux atinux added bug Something isn't working and removed cmty:bug-report bug Something isn't working labels Sep 15, 2020
@pi0 pi0 closed this as completed in #124 Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants