Repositories

Feed

IGassmann

IGassmann posted a new bug report

nuxt.js β€’ an hour ago

bug Nuxt checks for serverMiddleware file existence in sources instead of built files

Version

v2.0.0

Reproduction link

https://glitch.com/edit/#!/heady-cheque

Steps to reproduce

  1. Create a serverMiddleware file: $ touch ./src/api/index.js
  2. Add it to the config file:
{
    ...
    srcDir: 'src/',
    buildDir: 'dist',
    serverMiddleware: ['~/api/index'],
}
  1. Run $ nuxt build
  2. Deploy dist andnode_modules` directories to server
  3. Run $ nuxt start on the server (meaning without src/ directory)

What is expected ?

When Nuxt is started, it shouldn't check for a file existence in the sources, but check for a built one. We shouldn't need to deploy the sources into the server, but only the dependencies and the build directory (.nuxt or dist).

What is actually happening?

Nuxt will fail because it won't be able to resolve the middleware file since there isn't any src/ folder in the server.

renspoesse

renspoesse posted a new bug report

docs β€’ 3 hours ago

bug API docs mention deprecated build.vendor

Version

master

Reproduction link

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

Steps to reproduce

https://nuxtjs.org/api/configuration-build#vendor mentions how build.vendor can be used, while https://nuxtjs.org/guide/release-notes states that it's deprecated.

What is expected ?

The section should be removed

What is actually happening?

The section is still there

anton164

anton164 posted a new question

webpackbar β€’ 8 hours ago

Add stats for minification time and plugins

This issue is for a:

  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> bug
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> feature request
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> modification request

New Feature Use Case

Currently the only output shown is this:

Stats by Ext

╔════════╀══════════╀═══════╀══════════════╀══════════════════╗
β•‘ Ext    β”‚ Requests β”‚ Time  β”‚ Time/Request β”‚ Description      β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ js     β”‚ 1112     β”‚ 12s   β”‚ 11ms         β”‚ JavaScript files β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ jsx    β”‚ 369      β”‚ 2s    β”‚ 5ms          β”‚ jsx files        β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ hbs    β”‚ 295      β”‚ 3s    β”‚ 11ms         β”‚ hbs files        β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ less   β”‚ 45       β”‚ 641ms β”‚ 14ms         β”‚ less files       β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ less 0 β”‚ 19       β”‚ 853ΞΌs β”‚ 45ΞΌs         β”‚ less 0 files     β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ css 0  β”‚ 13       β”‚ 561ΞΌs β”‚ 43ΞΌs         β”‚ css 0 files      β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ svg    β”‚ 1        β”‚ 3ms   β”‚ 3ms          β”‚ svg files        β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ css    β”‚ 3        β”‚ 53ms  β”‚ 18ms         β”‚ css files        β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Total  β”‚ 1857     β”‚ 18s   β”‚              β”‚                  β•‘
β•šβ•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•


Stats by Loader

╔═══════════════════╀══════════╀═══════╀══════════════╀═══════════════════╗
β•‘ Loader            β”‚ Requests β”‚ Time  β”‚ Time/Request β”‚ Description       β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ babel-loader      β”‚ 1450     β”‚ 14s   β”‚ 9ms          β”‚ Babel Loader      β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ handlebars-loader β”‚ 295      β”‚ 3s    β”‚ 11ms         β”‚ Handlebars Loader β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ expose-loader     β”‚ 1        β”‚ 5ms   β”‚ 5ms          β”‚ Expose Loader     β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ css-loader        β”‚ 80       β”‚ 696ms β”‚ 9ms          β”‚ Css Loader        β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ postcss-loader    β”‚ 68       β”‚ 695ms β”‚ 10ms         β”‚ Postcss Loader    β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ less-loader       β”‚ 64       β”‚ 642ms β”‚ 10ms         β”‚ Less Loader       β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ exports-loader    β”‚ 29       β”‚ 316ms β”‚ 11ms         β”‚ Exports Loader    β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ imports-loader    β”‚ 19       β”‚ 256ms β”‚ 13ms         β”‚ Imports Loader    β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ raw-loader        β”‚ 1        β”‚ 3ms   β”‚ 3ms          β”‚ Raw Loader        β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Total             β”‚ 2007     β”‚ 19s   β”‚              β”‚                   β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

However, a lot of the webpack build time is also spent in minification and plugins, would it be possible to add that info?

ThomasKientz

ThomasKientz posted a new question

nuxt.js β€’ 9 hours ago

Unexpected token export

With nuxt 1.4 I had no issues with importing shared file/components from npm. But with Nuxt 2 I do.

import { convertTime } from "@bit/thomaskientz.vc.plugins.utils";

produces the error :

SyntaxError: Unexpected token export

If I created the file inside the project, there is no issue with the file.

Capture d’écran 2018-09-23 aΜ€ 14.19.41.png

// /node_modules/@bit/thomaskientz.vc.plugins.utils/utils.js

export const convertTime = t => {
  let h = Math.floor(t / 60);
  let m = t % 60;

  if (h < 10) h = "0" + h;
  if (m < 10) m = "0" + m;

  return h + "h" + m;
};

export const capitalizeName = string => {
  return string
    .toLowerCase()
    .replace(/(^|[\s-])\S/g, match => match.toUpperCase());
};

export const capitalizeFirstLetter = string => {
  return string.charAt(0).toUpperCase() + string.slice(1);
};

export const getPictureUrl = (url, options) => {
  return url
    ? process.env.VUE_APP_API_URL + "/uploads/" + url
    : options && options.type === "logo"
      ? "/images/vc-logo-white.svg"
      : "/images/profile-picture-placeholder.svg";
};
gera2ld

gera2ld posted a new feature request

nuxt.js β€’ 11 hours ago

idea Enable prefetch only for URLs being linked in current page

What problem does this feature solve?

Currently we can either enable or disable prefetch for all assets. That may be a bad idea for large applications.

By enabling prefetch only for URLs being linked in current page, we can benefit from prefetch in large applications without downloading the whole site.

johnRivs

johnRivs resolved the question #c7794

nuxt.js β€’ 12 hours ago

Replacing postcss config

Closed in favor of this feature request.

Atinux

Atinux fixed the bug report #c64 in v2.0.1

create-nuxt-app β€’ 12 hours ago

bug Error: Cannot find module 'nuxt-edge'
johnRivs

johnRivs posted a new feature request

nuxt.js β€’ 12 hours ago

idea Merge PostCSS config

What problem does this feature solve?

If I pass my own config to build.postcss, it will replace the default plugins along with their settings.
If I keep the default plugins by setting them to an empty object, like the docs show, I keep the plugins but not their settings.
In fact, the docs mention defaults but the code example isn't what's found in the source. If I want to add to Nuxt's default PostCSS setup, I shouldn't be expected to know that a certain file in the source contains the defaults I'm gonna have to copy and paste into nuxt.config.js. Unless I'm missing something very obvious, there's no elegant way of adding Tailwind for example while keeping these defaults.

manniL

manniL posted a new bug report

nuxt.js β€’ 12 hours ago

bug Extracted CSS is loaded all together

Version

v2.0.0

Reproduction link

https://github.com/manniL/nuxt-extract-css-include-bug/

Steps to reproduce

  1. Clone repo
  2. npm i
  3. npm run build && npm start
  4. open localhost:3000/ and localhost:3000/other

What is expected ?

  • localhost:3000/ -> Green background but no red color
  • localhost:3000/ -> No Green background but no red color

What is actually happening?

The CSS of both pages is loaded together.
When using scoped styles, the CSS doesn't overlap but is still loaded (which harms perf if you have a lot of components/CSS).

tonysworking

tonysworking posted a new question

axios-module β€’ a day ago

Possible CORS error, Postman Calls work to API but Store-> Actions-> Axios Calls to LOGIN do not work BCRYPT compare password fails.

This is a general NUXT question.

I am making an axios request to login a user, I can sign-up a user with no errors, but when i try to login, that newly made user with axios does not work, I get a 401 error

If i use postman to Create a user and Log in that same user It works perfectly.

If i use postman to login the user created with Axios it gives a 401 error.

is nuxt sending a different type of data to the server because I am converting a vueJS app to a nuxtApp and the VUEJS app works perfectly as well.

the API is its own app and runs on an entirely different port (2030) and has nothing todo with the Nuxt application, it has CORS set up in the app

app.use((req, res, next) => {
res.header("Access-Control-Allow-Origin", "*");
res.header('Access-Control-Allow-Headers', "Origin, X-Requested-With, Content-Type, Accept, Authorization");
if (req.method === 'OPTIONS') {
res.header('Access-Control-Allow-Methods', 'PUT, POST, PATCH, DELETE, GET');

    return res.status(200).json({});
}
next();

});

the failed code is as such:

API LOGIN

USER LOGIN
router.post('/login', (req, res, next) => {
console.log('request');
User.findOne({
email: req.body.email
})
.exec()

    .then(user => {
        if (user.length < 1) {
            return res.status(401).json({
                message: 'Authorization Failed'
            });
        }

    bcrypt.compare(req.body.password, user.password, (err, result) => {

            if (err) {
                return res.status(401).json({
                    message: err,
                });
            }

            if (result) {
                const token = jwt.sign({
                        email: user.email,
                        userId: user._id,
                    },
                    process.env.JWT_KEY, {
                        expiresIn: '1h'
                    });
                return res.status(200).json({
                    message: user,
                    token: token
                });
            }
            res.status(401).json({
                message: err,
            });
        });

    })
    .catch(err => {
        console.log(err);
        res.status(500).json({
            error: err
        });
    });

})

The Nuxt Store Action:

login({
commit,
state
}, authData) {
axios
.post("http://127.0.0.1:2030/users/login", {
email: authData.email,
password: authData.password,
returnSecureToken: true
})
.then(res => {
commit("authUser", {
token: res.data.token
});
state.userIncorrectLogin = "";
router.push("/dashboard");
})
.catch(error => {
state.userIncorrectLogin =
"Email Or Password is Incorrect Please try again or Reset Password";
});
},

The login.vue Methods:

methods: {
submit(email, password) {
this.$validator.validateAll();
if (!this.errors.any()) {
this.$store.dispatch("login", { email, password });
}
},

Any thoughts or recommendations on this issue.

Thanks in Advance.

Pitu

Pitu posted a new question

webpackbar β€’ a day ago

When serving nuxt in a development enviroment, the webpack UI gets messed up.
  • Operating System: Windows 10 1803
  • Node Version: v10.8.0
  • NPM Version: 6.2.0
  • webpack Version: Whatever comes with [email protected]
  • webpack-serve Version: Whatever comes with [email protected]

This issue is for a:

  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> bug
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> feature request
  • <input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"> modification request

Code

CLI Command
  $ nuxt

Expected Behavior

When using the command next it compiles, clears the console on most cases and then it shows you the ip and port where your app is being served on.

Actual Behavior

Lots of text gets left behind, progressbars don't even complete and it fails to show ip and port as shown on the following picture:

How Do We Reproduce?

Just by running the command nuxt.

braivre

braivre resolved the question #c7795

nuxt.js β€’ a day ago

Nuxt 2: Error installing coffeescript as indicated in the docs

I made it working following this example:
https://github.com/nuxt/nuxt.js/tree/dev/examples/coffeescript

Right after doing what docs indicate, add the coffeescript module:
https://github.com/nuxt/nuxt.js/blob/dev/examples/coffeescript/modules/coffeescript.js

And add it to the nuxt.config.js modules array.

mauxtin

mauxtin posted a new question

nuxt.js β€’ a day ago

Every page's styles are loaded on homepage after upgrading to Nuxt 2

Afte upgrading to Nuxt.js 2, I noticed that about 30 css files are loaded when the homepage loads. I actually noticed it when I checked Google Pagespeed Insights and saw about 30 "blocking CSS resources".

Is there a setting for lazy loading them or something like that?

sweetim

sweetim posted a new bug report

nuxt.js β€’ a day ago

bug host and port is not able to configure from nuxt.config.json

Version

v2.0.0

Reproduction link

https://gitlab.com/hosweetim/timx-site/blob/master/nuxt.config.js

Steps to reproduce

add the server object

server: {
        port: 8080,
        host: '0.0.0.0'
},

and run npm start

What is expected ?

The port and host should be configured based on the nuxt.config.json

What is actually happening?

Default value of host and port is used

Additional comments?

Follow this step to configure host and port
Configure in nuxt.config.json https://nuxtjs.org/faq/host-port

But when I run npm start, it is still using the default port and host

ConsoleTVs

ConsoleTVs posted a new bug report

auth-module β€’ a day ago

bug $auth not defined in plugin & resetOnError option is ignored...

Version

v4.5.1

Reproduction link

http://prntscr.com/kxf2s5

Steps to reproduce

Follow the steps in the small detailed guide…

What is expected ?

  • To have the $auth inside the plugin to use .onError
  • To log out the user if the request fails (resetOnError is true)

What is actually happening?

  • $auth is undefined
  • The user is not logged out, so I must find alternatives like using $auth in the plugin but I'm unable to…

Example failed request because bad token: http://prntscr.com/kxf48b
Result in the local storage: http://prntscr.com/kxf4i6

Additional comments?

nuxt.config.js:

    auth: {
        // See https://auth.nuxtjs.org/getting-starterd/options
        redirect: {
            login: '/',
            logout: '/',
            user: '/dashboard'
        },
        strategies: {
            local: {
                endpoints: {
                    login: { url: '/login', method: 'post', propertyName: 'token' },
                    logout: { url: '/logout', method: 'post' },
                    user: { url: '/user', method: 'get', propertyName: 'user' }
                },
            }
        },
        resetOnError: true
    },

Also, just as a side note, the login redirect is not working either… Login works tho.

ConsoleTVs

ConsoleTVs posted a new question

nuxt.js β€’ a day ago

loadingIndicator name is ignored

The loading indicatior name prop in nuxt.config.js is ignored. This is an error, here's what I get:

loadingIndicator : {
    name: 'pulse',
    color: '#e3342f',
    background: '#f1f5f8'
 },

image

potato4d

potato4d posted a new feature request

nuxt.js β€’ a day ago

idea Implementation of nuxtClientInit Action

What problem does this feature solve?

Currently, Nuxt.js does not have a way to create actions to be done only on the client.
It is possible to implement it using plugins and middleware, but it will be implemented with a different interface from nuxtServerInit.

Also, in SPA mode there is no equivalent of nuxtServerInit.

In order to solve this problem, I would like to add nuxtServerInit for clients.

What does the proposed changes look like?

I implemented it as a module of Nuxt.js. However, I want Nuxt.js core to have nuxtClientInit.

https://github.com/potato4d/nuxt-client-init-module


Although it was written that it is advancing the implementation before, is there any plan to implement it?

If possible, I would like to collaborate on implementation.

https://github.com/nuxt/nuxt.js/issues/1857#issuecomment-336874401

johnRivs

johnRivs posted a new feature request

nuxt.js β€’ a day ago

idea Suggestions for CSS handling in the future.

What problem does this feature solve?

Limited, not too nuanced CSS insertion options. Currently, you either inline or extract everything.
I'm aware some of the following could be made into 1 or more plugins. I'm not familiar with internals to understand what's able to be implemented in the context of Nuxt.

Avoiding requests for small size CSS

When extractCSS is set to true, CSS files above certain threshold would be <link>ed as usual and the ones below it would be inlined. @manniL explains very well in his PR the problem with <link>ing the smaller files.

I'll have a CSS file per component with a few (say ~5-25) lines of CSS in it, which are even smaller than the HTTP headers of the request to retrieve the file.

Reading about critical CSS, 14kb seems to be the sweet spot, although the number could be configurable. From this article

The magic number you should care about is 14kb. That’s (give or take) how much data a server sends per round trip when the browser makes a request for a web page. You want your above-the-fold contentβ€”required styles, scripts, markup, everythingβ€”to weight 14kb or less so that the browser can start rendering it as soon as that first packet of data is received.

From Filament Group

It’s helpful to consider some basic information about how our code is transferred during page load. Every request to the remote server takes time, and each response from the server carries a limited quantity of data. In order to aim for the fastest page loading time, we want to try to fit the code required for rendering the top portion of a given page in the first response from the server, which happens to carry around 14kb of compressed code (it’s often less, but 14’s a solid goal to shoot for).

Basically, we want fit the HTML, CSS, and JavaScript that’s necessary for Start Render in that first 14kb round trip.

I have a CSS file that weighs 20-30kb in disk and is served by Nuxt as a 5.8kb file. I take it that 14kb of compressed code suggests I should look at 5.8kb when comparing to the threshold. I don't know if figuring out the size of the file after compression but before serving is possible.

Allow inlined CSS to be cached

Borrowing from Filament Group's loadCSS's approach, after all the relevant assets are downloaded, fetch the CSS files below the threshold, i.e. the ones that were inlined. Then, set something in the client side (e.g. a cookie) that will let the server know inlined CSS is no longer required. From this point on, whatever CSS was inlined would now be <link>ed, since the browser has downloaded it.

Apply some voodoo to inlined CSS

Pass the inlined CSS through PurgeCSS, just like extracted files. I guess this is less PurgeCSS and more of a Webpack thing.

potato4d

potato4d posted a new bug report

nuxt.js β€’ a day ago

bug The path set to "background" can not be resolved.

Version

v2.0.0

Reproduction link

https://github.com/magitek-telescope/nuxt-v2-background-bug

Steps to reproduce

This bug is reproduction on Nuxt v2 only.

  1. clone [email protected]:magitek-telescope/nuxt-v2-background-bug.git
  2. yarn
  3. yarn dev

reproduction

on v1

Screen Shot 2018-09-22 at 21.58.17.png

on v2

Screen Shot 2018-09-22 at 22.01.26.png

What is expected ?

Images are displayed.

What is actually happening?

Images not displayed.

Additional comments?

On v2, path resolve is absoluted.
If change path resolve method from absolute to relative, I think that this problem will be solved.

bovas85

bovas85 posted a new bug report

nuxt.js β€’ a day ago

bug nuxtServerInit fires for each static dynamic route generated

Version

v2.0.0

Reproduction link

https://github.com/bovas85/nunziellasalluce.com

Steps to reproduce

  • run yarn on the repo, then yarn generate

You'll see a log in the server console:
============= Server Init API calls ============= along with other API calls
(don't worry I'm caching those on wordpress so feel free to try it out)

At the moment I've set the generate interval to 2500ms but feel free to remove it to try the issue out.

Ideally we should improve nuxt generate in order to only call the APIs once and then store in cache or a file.

I've spoken with @Atinux yesterday at VueConf London about this for reference.

(it's Moustache Design)

What is expected ?

The API calls should be cached and ran once per each nuxt generate (as it's the same code, it should be reused for each page in the app)

What is actually happening?

nuxtServerInit fires x amount of times as the number of pages in the app generated.

Additional comments?

Feel free to contact me here or on twitter at @moustachedsign