Activities

thrazu

thrazu posted a new question

docs •

Link to packages/vue-app/template/router.scrollBehavior.js doesn't work
thrazu

thrazu posted a new question

docs •

Link to packages/vue-app/template/router.scrollBehavior.js doesn't work
Chzfly

Chzfly posted a new feature request

docs •

idea Documentation: Add docs for using axios in async-data

What problem does this feature solve?

When i use axios from node_modules without create an instance serverRender will add the interceptors multiple. There is no description about this in docs.

FEA5T

FEA5T posted a new feature request

docs •

idea Please create documentation for components directory

What problem does this feature solve?

The documentation here https://nuxtjs.org/guide/directory-structure has detailed documentation for all directories except components.

I cannot get my project running in nuxt because I am not sure how to easily consume a component from a page.

What does the proposed changes look like?

Ideally I would like to know if components are auto registered globally, if I have to import them manually. If manual, provide an example including relative/absolute path (whatever is best practice). I would like to know what the naming conventions are, what characters are inappropriate, etc.

rtd21

rtd21 posted a new question

docs •

scroll behavior

the props scrollToTop: false don't help to stop scrolling page to top, when route is changed

Atinux

Atinux resolved the question #c198

docs •

Deploy with Now instructions no longer viable
ngaiwe

ngaiwe posted a new question

docs •

feserver 80端口代理localhost:3000 启动项目用localhost不能热更新

https://cmty.app/nuxt/issues/new?repo=docs
feserver 80端口代理localhost:3000 启动项目用localhost不能热更新

ngaiwe

ngaiwe posted a new question

docs •

feserver 80端口代理localhost:3000 启动项目用localhost不能热更新

feserver 80端口代理localhost:3000 启动项目用localhost不能热更新 ws报错500

MasterHiei

MasterHiei posted a new bug report

docs •

bug Unexpected type of Vue Router component in TypeScript

Version

[VERSION 2.8.X](https://github.com/docs/releases/tag/VERSION 2.8.X)

Reproduction link

https://nuxtjs.org/api/configuration-router#extendroutes

Steps to reproduce

Adding a custom route in nuxt.config.js like below:

export default {
  router: {
    extendRoutes (routes, resolve) {
      routes.push({
        name: 'custom',
        path: '*',
        component: resolve(__dirname, 'pages/404.vue')
      })
    }
  }
}

What is expected ?

pass without error

What is actually happening?

Get a type error.

Type 'string' is not assignable to type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<string, any>> | VueConstructor<Vue> | AsyncComponentPromise<...> | AsyncComponentFactory<...> | undefined'.ts(2322)
router.d.ts(77, 3): The expected type comes from property 'component' which is declared here on type 'NuxtRouteConfig'

Additional comments?

Is it a bug of TypeScript type definitions?

asolopovas

asolopovas posted a new question

docs •

how-to-deploy-on-azure-portal does not display the contents of web.config file.

Hi I have noticed that web.config details aren't displayed. It looks like contents in md file are correct but xml tags are rendered as html.

https://nuxtjs.org/faq/deployment-azure-portal#how-to-deploy-on-azure-portal

blowsie

blowsie posted a new feature request

docs •

idea Documentation: Add docs for using nuxt-start

What problem does this feature solve?

How to use nuxt-start

What does the proposed changes look like?

Include samples for environments like docker?

gap1994

gap1994 posted a new question

docs •

请问和mpvue一起开发小程序,怎么引入mpvue
m00nk

m00nk posted a new bug report

docs •

bug doc about fetch() is wrong

Version

0.10.7

Reproduction link

https://github.com/nuxt/docs/blob/master/ru/guide/vuex-store.md#%D0%BC%D0%B5%D1%82%D0%BE%D0%B4-fetch

Steps to reproduce

.

What is expected ?

fetch() gets the context

What is actually happening?

fetch() gets the object {store, params}

Additional comments?

The fetch does not gets the context, so there is no way to detect where is the method has been run: on the server or on the client.

Anaphase

Anaphase posted a new bug report

docs •

bug configuration-build pages do not load

Version

latest

Reproduction link

https://nuxtjs.org/api/configuration-build

Steps to reproduce

Try to load https://nuxtjs.org/api/configuration-build (or any of the anchor tags on that page.)

What is expected ?

The page should load the configuration-build docs.

What is actually happening?

The page does not load, instead showing a 404 error.

aytdm

aytdm posted a new question

docs •

Could you please delete wiki in the nuxt/docs repository?

Hi,
I created wiki in the nuxt/docs repository by mistake. Could you please delete it?
I'm sorry for bothering you but thank you for your cooperation. I promise I won't let it happen again.

sullivanpt

sullivanpt posted a new feature request

docs •

idea Unclear how to unit test Nuxt modules with Vue-Test-Utils

What problem does this feature solve?

I'd like a code sample explaining how to test a Nuxt Vuex module (https://nuxtjs.org/guide/vuex-store) (non classic mode) with Vue-Test-Utils "Testing a Vuex Store" (https://vue-test-utils.vuejs.org/guides/#testing-vuex-in-components). In particular I'm using Jest but any similar framework would do. In particular, there's logic built into Nuxt to transform a set of imports (state, getters, …) into a namespaced Vuex options object (packages/vue-app/template/store.js). It would be great if that logic could be exposed or mimicked from Nuxt or a companion library.

Apologize this description is a little fuzzy. I'll post below what I'm currently doing so hopefully it will be more clear what I am looking for

What does the proposed changes look like?

my nuxt Vuex store module 'store/cart.js'

export const state = () => ({
  loadingCount: 0
})

export const getters = {
  loading (state) { return !!state.loadingCount }
}

export const mutations = {
  startLoading (state) {
    state.loadingCount++
  },
  finishLoading (state) {
    state.loadingCount--
  }
}

my unit test 'tests/unit/store/cart.spec.js'

import { createLocalVue } from '@vue/test-utils'
import Vuex from 'vuex'
import { buildVuexFromNuxt } from '~/tests/mocks/nuxt-store.mock'
import * as cart from '~/store/cart'

test('cart default state is not loading', () => {
  const localVue = createLocalVue()
  localVue.use(Vuex)
  const store = new Vuex.Store(buildVuexFromNuxt(cart, 'cart'))
  expect(store.getters['cart/loading']).toBeFalsy()
})

and this is how I'm currently mimicking Nuxt's embedded behavior, that maybe should be built in?

// tests/mocks/nuxt-store.mock
import _cloneDeep from 'lodash/cloneDeep'

/**
 * mimics packages/vue-app/template/store.js
 * optionally nest to build { modules: { a: { namespaced: true, state, ... } } }
 * @param imports has form {
 *   export state = () => ({})
 *   export getters = {}
 *   export mutations = {}
 *   export actions = {}
 * }
 * @param name when a string, imports are built as a namespaced sub-module
 * @param rootOptions null or result of buildVuexFromStore(rootImports)
 */
export function buildVuexFromNuxt (imports, name, rootOptions) {
  const VUEX_PROPERTIES = ['state', 'getters', 'actions', 'mutations']
  //  cloneDeep is because Vuex mutates the options object used to create the store.
  const options = _cloneDeep(VUEX_PROPERTIES.reduce((acc, key) => {
    if (imports[key]) acc[key] = imports[key]
    return acc
  }, {}))
  if (!name) return options
  options.namespaced = true
  if (!rootOptions) rootOptions = buildVuexFromNuxt({ state: () => ({}) })
  if (!rootOptions.modules) rootOptions.modules = {}
  rootOptions.modules[name] = options
  return rootOptions
}
rstormsf

rstormsf posted a new bug report

docs •

bug Broken Link https://nuxtjs.org/faq/google-analytics

Version

2

Reproduction link

https://nuxtjs.org/faq/google-analytics

Steps to reproduce

Go to https://nuxtjs.org/faq/google-analytics

What is expected ?

Success ( 200)

What is actually happening?

500

rstormsf

rstormsf posted a new question

docs •

Broken Link https://nuxtjs.org/faq/google-analytics
rstormsf

rstormsf posted a new question

docs •

Broken link https://nuxtjs.org/faq/google-analytics
smth

smth posted a new question

docs •

Deploy with Now instructions no longer viable

Docs say "You cannot deploy a server-side-rendered Nuxt app with Now V2 right now. Please use Now V1 for such apps."

However, it appears that V1 is no longer permitted by Now; so the above suggestion is not possible.