Activities

pimlie

pimlie posted a new feature request

http •

idea change browserBaseUrl default value to '/'

What problem does this feature solve?

Currently the default value of browserBaseUrl is baseUrl which works correctly if you are running your server on localhost as well. But when running Nuxt with HOST=0.0.0.0 then baseUrl and thus browseBaseUrl still fallbacks to localhost. This is fine for baseUrl, but browserBaseUrl shouldnt probably be pointing to localhost.

Related issue: https://github.com/nuxt/press/issues/2 (as fix in nuxtpress I just added browserBaseUrl: '/' as option)

What does the proposed changes look like?

Set default value for browserBaseUrl to /

jefrydco

jefrydco posted a new feature request

http •

idea Integrate Nuxt Progress Bar

What problem does this feature solve?

Nuxt HTTP documentation states that this module isn't integrated yet with nuxt progress bar because of this https://github.com/sindresorhus/ky/pull/34 isn't merged. But now it has merged.

What does the proposed changes look like?

Integrate nuxt progress bar

tony19

tony19 posted a new question

http •

Using $http in asyncData with vue-property-decorator

Following the @nuxt/http usage guide, I added { $http } to the arguments of asyncData in my Nuxt TypeScript project:

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import Post from '~/models/Post'

@Component({
  components: {
    PostPreview: () => import('~/components/PostPreview.vue')
  },
  async asyncData({ $http }) {
    const { data } = await $http.get(`https://my-api/posts`)
    return {
      posts: data
    }
  }
})
export default class FeedPage extends Vue {
  posts: Post[] = []
}
</script>

but it causes a TypeScript error:

Property '$http' does not exist on type 'Context'.

Screen Shot 2019-05-28 at 10.12.46 AM.png

Screen Shot 2019-05-28 at 10.14.56 AM.png

bovas85

bovas85 posted a new bug report

http •

bug Cannot generate dynamic routes with nuxt generate

Version

^0.1.2

Reproduction link

https://github.com/bovas85/nunziellasalluce.com

Steps to reproduce

Clone the repo
yarn
yarn generate

axios is not being used, ky is used instead which fails after timing out

What is expected ?

axios is used in nuxt.config as per imported

What is actually happening?

axios is not being used, ky is used instead which fails after timing out

Lisiadito

Lisiadito posted a new question

http •

import of type for JSONValue missing

Using the @nuxt/http module with TypeScript leads to an error Cannot find name JSONValue
The type JSONValue must be imported from ky.

I can't open an issue via CMTY because the link is not working.

pi0

pi0 posted a new question

http •

allow creating new instances

Advanced use case. Inside a plugin create a new instance for multi baseURL or custom headers support.

plugins/http.js

export default function ({ $http }, inject) {
  inject('blog', $http.create({
    baseURL: 'http://blog.mywebsite.com/api'
  }))
}