Repository nuxt.js

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?

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
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)

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 • 18 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.

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>
Atinux

Atinux resolved the question #c2263

nuxt.js • 2 days ago

Remove nuxtServerInit code from client-side app bundle

It is removed with nuxt-edge (so Nuxt 2.0 soon).

manniL

manniL resolved the question #c2473

nuxt.js • 2 days ago

Multiple error layouts

Instead of multiple error layouts, you could create error-components and display them depending on the error/status code.

clarkdo

clarkdo resolved the question #c2399

nuxt.js • 2 days ago

svg-sprite-loader and nuxt?
FistMeNaruto

FistMeNaruto posted a new bug report

nuxt.js • 2 days ago

bug Vue-svg-loader not working with Nuxt

Version

v1.4.2

Reproduction link

https://github.com/FistMeNaruto/vue-svg-loader-test

Steps to reproduce

Do everything described in https://vue-svg-loader.js.org/ documentation.

What is expected ?

SVG of a circle on the homepage

What is actually happening?

SVG gets converted to base64 even though svg files should not be processed by the url loader anymore.

Additional comments?

Issue on vue-svg-loader repo: visualfanatic/vue-svg-loader#41

manniL

manniL implemented the feature request #c7564

nuxt.js • 2 days ago

idea Router hooks not working
KindWizzard

KindWizzard resolved the question #c2582

nuxt.js • 3 days ago

What about progressive rendering?

https://ssr.vuejs.org/en/streaming.html

However, when the first data chunk is emitted, the child components may not even be instantiated yet, neither will their lifecycle hooks get called. This means if the child components need to attach data to the render context in their lifecycle hooks, these data will not be available when the stream starts. Since a lot of the context information (like head information or inlined critical CSS) needs to be appear before the application markup, we essentially have to wait until the stream to complete before we can start making use of these context data.

It is therefore NOT recommended to use streaming mode if you rely on context data populated by component lifecycle hooks.

clarkdo

clarkdo implemented the feature request #c7161

nuxt.js • 3 days ago

idea [edge] Better error handling if plugin src file is missing