Repositories

Feed

luishdz1010

luishdz1010 posted a new feature request

nuxt.js • 2 hours ago

idea Allow layouts or the error layout to use fetch/asyncData

What problem does this feature solve?

My error page lives in a layout that needs to pull data for menus/footer, since layouts can't have fetch/asyncData blocks I normally add the fetch logic to the pages that use a specific layout. However this workaround doesn't work for the error page since it is not a page, but a layout.

This can't be done on NuxtServerInit because:

a) requests dispatched in nuxtServerInit are blocking, i.e. nuxt waits until the promise returned from nuxtServerInit is resolved before continuing, which makes things x2 slower when a page has other requests to make (all requests can and should be run in parallel)
b) different layouts have different fetch needs
c) wouldn't work on SPA mode

Do you guys have any workaround for this? Currently, my 404 error pages render with an empty footer and menu.

What does the proposed changes look like?

Add fetch and/or asyncData support to layouts, or at least the error layout.

NickSynev

NickSynev posted a new question

nuxt.js • 6 hours ago

Nuxt router in the separate service?

How can I import nuxt router in the separate service without sending it from component?

besnikh

besnikh posted a new question

localforage-module • 6 hours ago

How to use localForage with Vuex ?

Hi,

I am able to use local forage as a method, but I can not use it in store.. I tried different options but I could not manage to do it.

As a method, this is what I am doing

async localForage () {
      let data = {
        name: 'test',
        operation: 'Nav-Business'
      }
      await this.$localForage.setItem('nav', data)
        .then(data => {
          console.log('Working', data)
        })
        .catch(error => {
          console.log(error)
        })
    }

Thnx in advance

carneiroskeeled

carneiroskeeled posted a new feature request

nuxt-i18n • 6 hours ago

idea Accept a promise in the pages option

What problem does this feature solve?

In my project I don't have the routes (pages and respective translations) available until I generate/run nuxt since I am getting it from another source (Contentful), and getting them from Contentful is a promise. Shouldn't nuxt-i18n accept a promise in this option or is there a better way to do this?

potato4d

potato4d resolved the question #c57

create-nuxt-app • 9 hours ago

bash: create-nuxt-app: command not found

@himanshu64

Can not solve with the following command?

$ export PATH="/home/dell/.npm-global/bin:$PATH"
$ create-nuxt-app <project-name>
woodgates

woodgates fixed the bug report #c56

create-nuxt-app • 9 hours ago

bug statusCode: 404
manniL

manniL fixed the bug report #c7604

nuxt.js • 10 hours ago

bug [edge] error TypeError: request.charCodeAt is not a function
galvez

galvez fixed the bug report #c7604

nuxt.js • 10 hours ago

bug [edge] error TypeError: request.charCodeAt is not a function
renoirb

renoirb posted a new feature request

create-nuxt-app • 11 hours ago

idea When using Koa alongside Nuxt, ability to use different `router.base` from root, and that Koa follows suit

What problem does this feature solve?

Have Koa function alongside Nuxt, when Nuxt has a different context-root than / (e.g. have /foo/, instead of /, as in http://example.org/foo/).

Nuxt supports to tell which context-root (e.g. instead of //foo/) to use when running with nuxt.config.js's router.base option. (see nuxt.js/…/configuration-router)

// nuxt.config.js
module.exports = {
  router: {
    base: '/foo/'
  }
}

But when using Koa alongside Nuxt, Koa throws exceptions.

This might just be a matter of having the right combination of settings, initialized in the right order. But which settings, and where is the question

P.S. This is an issue created by the request of @clarkdo, following up nuxt/koa-template - Document how to also make Koa match Nuxt's router.base #c29

What does the proposed changes look like?

  1. Some setting that says what is the baseUri to use, defaults to / as usual
  2. Both Nuxt and Koa takes the configuration into account
  3. Should work in any deployment mode: dev, compiled, etc.

P.S.: I've started working towards this while refactoring clarkdo/hare (see renoirb/experiments-nuxt-koa-env-runtime-201806, branch rework-hare-20180619 as a starting point)

manniL

manniL posted a new bug report

nuxt.js • 12 hours ago

bug [edge] error TypeError: request.charCodeAt is not a function

Version

2.0.0-25573630.6bfa68d and up

Reproduction link

https:/-/

Steps to reproduce

Several people (including me) receiving error TypeError: request.charCodeAt is not a function

It's not present in 2.0.0-25569931.85a8af5 but is present in 2.0.0-25573630.6bfa68d

Seems like it's only reproducible when modules are included.

Related: https://github.com/nuxt-community/nuxtent-module/issues/179, https://github.com/nuxt-community/auth-module/issues/229

More information as I can retrieve

What is expected ?

No error

What is actually happening?

Start a nuxt app with npm run dev and see the error in the console: error TypeError: request.charCodeAt is not a function. Breaking for windows-user as the command will stop

manniL

manniL posted a new bug report

nuxt.js • 12 hours ago

bug error TypeError: request.charCodeAt is not a function

Version

v1.4.2

Reproduction link

https://-/

Steps to reproduce

Several people (including me) receiving error TypeError: request.charCodeAt is not a function

Seems like it's only reproducable when modules are included.

Related: https://github.com/nuxt-community/nuxtent-module/issues/179, https://github.com/nuxt-community/auth-module/issues/229

More information as I can retrieve

What is expected ?

No Error

What is actually happening?

Start a nuxt app with npm run dev and see the error in the console: error TypeError: request.charCodeAt is not a function. Breaking for windows-user as the command will stop

LiangNex

LiangNex resolved the question #c7594

nuxt.js • 13 hours ago

What's the entry point of Nuxt?

It turns out that I went to the wrong direction 😆 , sorry I am fresh to systemd. At first, I thought I had to know the entry point of Nuxt to make it work on my own server. I found another solution inspired by here, in that way, just yarn start is enough.

After changing it to following code, it works like a charm.

[Service]
WorkingDirectory=/var/www/app
ExecStart=/usr/bin/yarn start

Sorry for bothering and thanks for your explanations. (bow)

SunXiao-Qi

SunXiao-Qi posted a new question

example-auth0 • 15 hours ago

~/config.json in ./utils/lock.js

This dependency was not found:

  • ~/config.json in ./utils/lock.js

请问怎么解决?

zajca

zajca posted a new bug report

nuxt.js • 17 hours ago

bug [edge] imported lib in nuxt.config.js is missing in generated files

Version

2.0.0-25578134.eb114a4

Reproduction link

https://github.com/zajca/nuxt-bug-5b98c1c

Steps to reproduce

run npm run dev
there is router config for parseQuery/stringifyQuery using qs lib

What is expected ?

qs will be imported in .nuxt/router.js

What is actually happening?

function in router config is copied to router.js but not dependency

UltramarineLights

UltramarineLights posted a new question

nuxt.js • 17 hours ago

Can't load @font-face after changing postcss customProperties value

Hi there! I'm trying to set as CSS custom properties two fonts I'm using in my project.
I have a global CSS file with the custom properties, then referenced in another file to set the @font-face.
By default Nuxt doesn't pass the properties to the components, so following the documentation I added a rule to the 'build' property in the 'nuxt.config.js'. If I now try to use custom properties for values everything works fine, but the urls are not rendered.
Basically I see in my inspector that the font names are passed as values to the properties but the fonts are not loaded.

MrTung

MrTung posted a new question

hare • 18 hours ago

why npm run generate,no html in dist?

HI, in my app,im run "npm run generate",but no html in my dist,and im tried many times,but still no html。

plz help me!! !

node -v :10.2.1;
npm -v :5.6.0;
nuxt-edge: "latest";

paulgv

paulgv resolved the question #c2547

nuxt.js • a day ago

Dynamic route without index file

Try with this files structure:

recipes/
├── _slug.vue

And use validate method in _slug.vue to ensure the slug isn't empty.

CoolGoose

CoolGoose posted a new bug report

nuxt.js • 2 days ago

bug Components rendering issues in the Layout

Version

v1.4.2

Reproduction link

https://github.com/CoolGoose/nuxtlayoutdebug

Steps to reproduce

I've added a repo that contains the code.
I've used vuex-flash as an example, but it happened with a custom component as well.

What is expected ?

Rendering the message in the layout as well

What is actually happening?

It only renders in the page

clarkdo

clarkdo implemented the feature request #c6920

nuxt.js • 2 days ago

idea Pass props to nuxt-child

This works in latest nuxt-edge

pages/child.vue:

<template>
  <nuxt-child :test="'RESOLVE_PLZ'"/>
</template>

pages/child/index.vue:

<template><h1> DO IT! </h1> </template>
<script>
export default {
  props: ["test"],
  mounted(){
    console.log(this.test) //RESOLVE_PLZ
  }
}
</script>
Atinux

Atinux implemented the feature request #c6920

nuxt.js • 2 days ago

idea Pass props to nuxt-child

This works in latest nuxt-edge

pages/child.vue:

<template>
  <nuxt-child :test="'RESOLVE_PLZ'"/>
</template>

pages/child/index.vue:

<template><h1> DO IT! </h1> </template>
<script>
export default {
  props: ["test"],
  mounted(){
    console.log(this.test) //RESOLVE_PLZ
  }
}
</script>