Activities

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.

nh0627

nh0627 posted a new question

docs •

Git commit changes at this moment is not displayed on the docs
tangxinming0310

tangxinming0310 posted a new question

docs •

nuxt项目引入element-ui启动后访问就报错

在nuxt项目中引入element-ui后,启动成功后,访问就报错ReferenceError HTMLElement is not defined

Jolg42

Jolg42 posted a new question

docs •

French version stuck in version 1.4.0?

I think the french version is in 2.x at least but the json mention 1.4.0 (and the header of the docs on the website too)
See https://github.com/nuxt/docs/blob/master/fr/lang.json#L3
Do you know what is the current version?

tangxinming0310

tangxinming0310 posted a new question

docs •

Start error reporting after initializing the project

nitialize the project with NPX create-nuxt-app < project name >, enter the project path, run the command NPM run dev to start successfully, access and display Reference Error in browser

HTMLElement is not defined

xxRockOnxx

xxRockOnxx posted a new feature request

docs •

idea Mention serverMiddleware uses router's base

What problem does this feature solve?

I was confused why my serverMiddleware does not work only to find out after a couple of experimentation that it would only work if I prepend the router's base path.

I thought serverMiddleware was called before everything else including router's configuration but it wasn't.

khrome83

khrome83 posted a new bug report

docs •

bug TypeScript setup broken in newest version

Version

2.5.x

Reproduction link

https://nuxtjs.org/guide/typescript/

Steps to reproduce

Follow Installation Guide Here - https://nuxtjs.org/guide/typescript/

What is expected ?

TypeScript works as expected…

What is actually happening?

The pages/feed.vue file throws a TypeScript error.
Screen Shot 2019-04-17 at 6.51.05 AM.png

Additional comments?

The code is copied and pasted exactly. After tons of research, I can't find a workaround with the exception of setting up *.d.ts files and overriding the behavior or turning off StrictFunctions. I am new to typescript​ and was really relying on this guide to integrate with it.