jefrydco

jefrydco posted a new feature request

nuxt-i18n • 2 hours ago

idea Add Callback or Context to Lazy Load when Exporting Promise

What problem does this feature solve?

It takes time to resolve the translation data if it reaches out server, so currently when it used in $t() method, it will displayed the path first then when the page changes several times it will display the correct translation.

Or perhaps we can make $t method or v-t directive reactive.

What does the proposed changes look like?

export default (context) => {
  return new Promise((resolve) => {
    resolve({
      welcome: 'Welcome'
    })
  });
}
sergiocastrovale

sergiocastrovale posted a new question

nuxt-i18n • 3 hours ago

Locale ISO code is required to generate alternate link

Whenever I load the app I get multiple warnings saying Locale ISO code is required to generate alternate link. I tried to figure out what could be wrong in my config but didn't reach any conclusion.

Here's how I'm setting it up:

    ['nuxt-i18n', {
      locales: [
        {
          code: 'en',
          name: 'English',
          file: 'en.js'
        }
      ],
      strategy: 'prefix_except_default',
      defaultLocale: 'en',
      lazy: true,
      langDir: 'lang/'
    }]

All my routes are auto-generated by nuxt under the pages directory, and to reach them I'm using something like:

  <nuxt-link :to="localePath('users-dashboard')">
    {{ $t('users.DASHBOARD') }}
  </nuxt-link>

Any suggestion would be appreciated.

makoso

makoso posted a new bug report

nuxt.js • 4 hours ago

bug Blank page after nuxt update content

Version

v1.4.0

Reproduction link

https://devkm.pl

Steps to reproduce

Open page https://devkm.pl

I dont have open repo fir this app but, i can try to reproduce it with empty project, when i test and try repair it i see it is because i use position absolute; and height: 100vh; on some blocks.

What is expected ?

Visible content on a page

What is actually happening?

Content is hidden after js run on the browser Chrome on Windows (tested windows 10 and windows 8) and on Safari on Mac, on linux works good, on edge too, on opera sometimes work 😮

Additional comments?

General i create bug because question doesn't created on github. https://cmty.app/nuxt/nuxt.js/issues/c7412 <- related can be deleted.

Full describe:

I have an unusual problem :(
In the application I use SSR and I have an error on the browser Chrome on Windows (tested windows 10 and windows 8) and on Safari on Mac, on linux works good, on edge too, on opera sometimes work 😮 but a part of form is hidden, when we make f5 it works but when we make ctrl + f5 it not works

What i see it is because i have content on position absolute with 100vh, when remove this styles it start works, but…. i need that styles

The problem is as follows:
The server renders the content of the page and displays it (I see the blink of content) then launches js (I think) and adds different attributes in html, probably replacing the body / document at this moment the content of the page disappears (but only from the view, the source is) and only the background remains … how to restore content? "just" reduce the browser window, or change the position of some element using js, as if to trigger some action on the page content, everything returns to normal and during the use of the application, this problem does not occur, it appears only when you first open the page, you can check here: https://devkm.pl Do you have any idea?

tonylampada

tonylampada posted a new question

nuxt.js • 5 hours ago

Can Nuxt.js listen to a unix socket instead of a port?

How?

makoso

makoso posted a new question

nuxt.js • 13 hours ago

Blank page after nuxt update content

Hi,

I have an unusual problem :(
In the application I use SSR and I have an error on the browser Chrome on Windows (tested windows 10 and windows 8) and on Safari on Mac, on linux works good, on edge too, on opera sometimes work 😮 but a part of form is hidden, when we make f5 it works but when we make ctrl + f5 it not works

What i see it is because i have content on position absolute with 100vh, when remove this styles it start works, but…. i need that styles

The problem is as follows:
The server renders the content of the page and displays it (I see the blink of content) then launches js (I think) and adds different attributes in html, probably replacing the body / document at this moment the content of the page disappears (but only from the view, the source is) and only the background remains … how to restore content? "just" reduce the browser window, or change the position of some element using js, as if to trigger some action on the page content, everything returns to normal and during the use of the application, this problem does not occur, it appears only when you first open the page, you can check here: https://devkm.pl Do you have any idea?

chesscai

chesscai posted a new question

nuxtjs.org • 13 hours ago

'file does not appear' in S3 when refresh without '/index.html'

Hi, nuxt generate and then publish /dist to S3.
It work fine as I visit mydomain.com and go to mydomain.com/about(use nuxt-link).
But if I refresh in mydomain.com/about , S3 return "file does not appear" because mydomain.com/about/index.html only can.

I just know that i can conf many cdn to map all routesuse Error pages to return index.html
So If any other solution?And how nuxtjs.org do?
Thanks.

anthinkingcoder

anthinkingcoder posted a new question

nuxt.js • 15 hours ago

SyntaxError: Unexpected token ...

Version:1.4.1
When I execute the command: npm run dev,a mistake was made

/node_modules/nuxt/lib/core/middleware/nuxt.js:72
const policies = this.options.render.csp.policies ? {...this.options.render.csp.policies} : null
SyntaxError: Unexpected token ...

how to solve?

highalps

highalps posted a new bug report

nuxt.js • 17 hours ago

bug serverMiddleware not working in docker environment

Version

v1.4.0

Steps to reproduce

  1. setting nuxt.config.js serverMiddleware
    serverMiddleware: [
        (req,res,next) => { console.log('logger1 : ', req.url);next()},
        { path: '/api', handler: (req,res,next) => {console.log('api'); res.end('api')}},
         (req,res,next) => {console.log('logger2 : ', req.url);next()}
    ]
  1. nuxt dev or nuxt build, nuxt start and request to /api url then checked 'api' response and logged well

  2. but when docker environment, nothing happened with /api request(log, and 'api' message response) but
    page not found error log like nuxt:render Rendering url /api +54ms

What is expected ?

it also 'api' response and 'api' log with /api request in docker

What is actually happening?

nuxt:render Rendering url /api +54ms not found 404 error occurred

franklion

franklion posted a new question

nuxt.js • 17 hours ago

static folder path problem

I have a problem with static folder path in the sub-domain.
The URL is http://test.com.tw/2018/ on my website, and then I put generated files in the 2018 folder.
But when I execute "npm run generate", the index.html that can't find the image.

So I google some issue about this topic, I found one solution
To modify nuxt.config.js
router: { base: "/2018/" }
This method not only can transform the router path but also assets folder path.
BUT It can't transform a static folder path, it's still served in the root path.

For example:
<img src="/logos/logo.png">

I want this
<img src="/2018/logos/logo.png">

Can Someone tell me how to modify nuxt.config.js?

Thanks: D

uniibu

uniibu posted a new question

nuxt.js • a day ago

Spa mode with extractCSS preloads the css files as script

Hello, I just have a few clarifications, as the title says, it seems that when using spa mode with extractCSS, it preloads the css files as a script instead of style as shown by the image below. I'm using [email protected]

preloadimage

The relevant code which generates this i think is https://git.io/fNZ65. My question is, is that how it should really work, since according to https://www.w3.org/TR/preload, it should use the proper as type when preloading resources.

And because of the wrong as type, Chrome spits out a warning message The resource .../_nuxt/23b48bf4ba0246acf08a.css was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

willy1412

willy1412 posted a new question

hare • a day ago

How to do Promise in NuxtJs?

I have this Axios Async Await code in Nuxt.js, I am not sure on how and where to put the Promise.all here. I am new at async await. I am trying to promise the getThemes() and getData(). Could somebody help me with the Promise.all code?

mounted() {
this.getThemes();
this.getData(this.$route.params.id);
},
methods: {

async getThemes() {
  this.loading = true;
  await axios.get(`${process.env.API_URL}/v1/communication/email-themes`, {
  }).then((response) => {
    this.theme = response.data.data;
    this.selected = this.theme.filter(t => this.themeId === t.id)[0].id;
    this.loading = false;
  }).catch((error) => {
    this.loading = false;
    this.errormsg = error.response.data.message;
  });
},

async getData(id) {
  this.loading = true;
  await axios.get(`${process.env.API_URL}/v1/communication/email-templates/${id}`)
    .then(({ data }) => {
      this.templateName = data.data.name;
      this.templateCode = data.data.content;
      this.themeId = data.data.theme_id;
      this.loading = false;
    }).catch((error) => {
      this.loading = false;
      this.errormsg = error.response.data.message;
    });
},
caoshining

caoshining posted a new question

docs • a day ago

Why Chinese documents are not the same as English documents

Why Chinese documents are not the same as English documents?

franklion

franklion posted a new question

nuxt.js • a day ago

static folder path problem

I have a problem with static folder path in the sub-domain.
The URL is http://test.com.tw/2018/ on my website, and then I put generated files in the 2018 folder.
But when I execute "npm run generate", the index.html that can't find the image.

So I google some issue about this topic, I found one solution
To modify nuxt.config.js
router: { base: "/2018/" }
This method not only can transform the router path but also assets folder path.
BUT It can't transform a static folder path, it's still served in the root path.

For example:
<img src="/logos/logo.png">

I want this
<img src="/2018/logos/logo.png">

Can Someone tell me how to modify nuxt.config.js?

Thanks: D

manniL

manniL resolved the question #c7396

nuxt.js • a day ago

Can't make use of mixins

I think the nuxt-sass-resource-loader is what you are looking for :)

stecapra

stecapra posted a new question

axios-module • a day ago

Cannot get the cookies in middleware http request

Hi,
i'm trying to implement an auth middleware, with an http request to my backend server the check if there is a cookie with a session id, but every time i make the request in the middleware, the result is always like the user is not logged in.
Instead, if i make the same request in mounted function of my page, everything works perfect.
I searched and found this topic https://cmty.app/nuxt/nuxt.js/issues/c401 where it said that the axios module has a built in fix method, but for me it doesn't work , and i already posted a comment there, but since is closed i think that no one saw my reply.
Why there is still this problem?

Thank you in advance

SAGV

SAGV posted a new question

sentry-module • a day ago

Using Raven in nuxtServerInit?

Is there any way to use Raven within nuxtServerInit method and inside other store actions?

Unfortunately, $raven is not passed as a part of context.app like context.app.$axios, for example.

tuotuogenjudi

tuotuogenjudi posted a new question

nuxt.js • a day ago

When I use npm run generate to package and use, the page refresh does not execute the public middleware, then how should I get the data when I refresh the page;
highalps

highalps posted a new question

nuxt.js • a day ago

Unexpected identifier in serverMiddleware

i'm using serverMiddleware config with nuxt
but in serverMiddleware, error occurred when using import statement or typescript (like interface..)
like this

 interface IIssue {
            ^^^^^^
  SyntaxError: Unexpected identifier
  import express from 'express'
         ^^^^^^^
  SyntaxError: Unexpected identifier

before using it, applied ts-loader also.
other directory like components or store work well with this statements

how can i using this identifiers in serverMiddleware?

MunchTZB

MunchTZB posted a new question

nuxt.js • 2 days ago

Module build failed when extract css

image
image

When nuxt build, there is an error when extractCSS is configured to { allChunks: true }.
But it can fixed when i add ident:'postcss' in the postcss config in nuxt/lib/builder/webpack/postcss.js

image

Here is my dependencies.
image

sotayamashita

sotayamashita posted a new question

hare • 2 days ago

[Suggestion] Improve pull request triage workflow

Recently, I created a bot to solve my own pain. As an engineer, I spent my time to check pull requests status such as WIP, reviewed, need change or approved. I would like to know whether you have same issue or not. If you have, please give it a try.

https://probot.github.io/apps/pr-triage/

Thanks in advance :bow:

Latest Releases see all

Updates of dependencies and cleanup (v4.0.0-rc.0)

Released 4 days ago

Bugfix release of missing cache (v4.0.0-beta.8)

Released 7 days ago

Add possibility to extend options with path to config file (v4.0.0-beta.6)

Released 12 days ago
Stats
49 repos
8928 commits
5155 issues
233 releases
4956 contributors