Repositories

Feed

victor192

victor192 posted a new bug report

nuxt.js β€’ 6 hours ago

bug Chunkhash is not added to the app.js in production mode

Version

v2.3.1

Reproduction link

https://www.example.org

Steps to reproduce

npm run build

What is expected ?

Whats to app.js will be added chunkhash

What is actually happening?

In nuxt.config.js I have the following setting of the option build.filenames:

filenames: {
        app: ({ isDev }) => isDev ? '[name].js' : '[chunkhash].js',
        chunk: ({ isDev }) => isDev ? '[name].js' : '[chunkhash].js',
        css: ({ isDev }) => isDev ? '[name].css' : '[contenthash].css',
        img: ({ isDev }) => isDev ? '[path][name].[ext]' : 'img/[hash:7].[ext]',
        font: ({ isDev }) => isDev ? '[path][name].[ext]' : 'fonts/[hash:7].[ext]',
        video: ({ isDev }) => isDev ? '[path][name].[ext]' : 'videos/[hash:7].[ext]'
},

However, in production mode file has name /_nuxt/app.js. Why is it called so if it should be added chunkhash?

Jones-S

Jones-S posted a new question

nuxt.js β€’ 10 hours ago

How to use a webpack loader in a nuxt.config

Hi there

I am struggling with understanding the docs on how to add a webpack loader into my nuxt project.
I created a minimal nuxt project where I try to use modernizr (using https://github.com/itgalaxy/webpack-modernizr-loader ).
https://github.com/Jones-S/nuxt-modernizr

Unfortunately how I did it does not work.
Here is the part of the nux.config where I try to add the loader:

/*
  ** Build configuration
  */
  build: {
    /*
    ** You can extend webpack config here
    */
    extend(config, { isDev, isClient }) {
      // Run ESLint on save
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })

        config.module.rules.push({
          test: /\.modernizrrc\.js$/,
          use: { loader: 'webpack-modernizr-loader' }
        })

        config.resolve.alias['modernizr'] = '/.modernizrrc.js'

      }
    }
  }

And then I try to import modernizr in pages/index.vue.
This will throw an error though:

    ERROR  Failed to compile with 1 errors
    This dependency was not found:
    * modernizr in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/index.vue?vue&type=script&lang=js&
    To install it, you can run: npm install --save modernizr

I can ensure that modernizr is installed.

I created an issue within the modernizrloader repo and asked for help.
https://github.com/itgalaxy/webpack-modernizr-loader/issues/95

I was told that I should exclude the vue-loader (which is also very unclear to me).

I would appreciate some help on how to use loaders with nuxt.js.
I fully read the docs, but I don't understand what I'm doing wrong.

(And I could also not find the way I am trying to use the new loader within the build.extend in the docs anyway…)

Thank you for your help.
Cheers

dylanmcgowan

dylanmcgowan posted a new feature request

apollo-module β€’ 11 hours ago

idea Please update apollo to the neweset version... is this project staying maintained?

What problem does this feature solve?

The version of vue-apollo that @nuxtjs/apollo uses is riddled with bugs. The maintainer has squashed a lot of them (almost two weeks ago) and has since released a new version.

In particular there was a bug with SSR that screams and throws errors with plugins that modify the vue prototype i.e. vee-validate.

Ive been locked in nuxt 1.4 because of this package. And I really don't want to be. Can you please update this projects dependencies?

What does the proposed changes look like?

Upgrading vue-apollo to 3.0.0.beta-26

lucaspatel

lucaspatel posted a new question

auth-module β€’ 12 hours ago

Function of callback

Hello,

I am trying to implement some logic in the callback after auth. I want to access the fields of the return auth store within the Vue instances of the callback page, if possible, and then do some logic there. Depending on what Vue functions I use (created/mounted) I either can't access the this.$auth or the callback redirects before the logic can take place. What are my options for making the callback wait a little bit so some async functions call finish; is it even possible for me to access the $auth fields at this point? If not, where can I add conditional logic that runs only after successful authentication? Should I put it on the page that the callback redirects to, with a check for auth or not?

Best,

Lucas

aszaffranietz

aszaffranietz posted a new bug report

nuxt.js β€’ 12 hours ago

bug Dynamic store has undefined state

Version

v2.3.1

Reproduction link

https://codesandbox.io/s/xrkwnonowo

Steps to reproduce

  • Check out the Reproduction Link
  • In dynamic-store/dynamic.js is a console.log(state)
  • On initial page load you will see the state is filled (logged on console)
  • Navigate to "About" with the Nuxt-Link and back to the Homepage
  • Now the State of the dynamic registered store is undefined

What is expected ?

I would expect that the dynamic registered Vuex Store would be accessible without errors.

What is actually happening?

An error is thrown because the state of the dynamic registered store is undefined.

Additional comments?

I debugged that locally and the store is registered correctly, but it seems that the watcher on a computed property gets evaluated before the store is ready.

The problem occurred just with Nuxt v2.x
Here is a Sandbox with Nuxt v1.x that works: https://codesandbox.io/s/z3r9zk1y43

ricardogobbosouza

ricardogobbosouza posted a new feature request

nuxt.js β€’ 13 hours ago

idea New directory to errors

What problem does this feature solve?

1 - With this new feature, I believe that the structure of the app stay more organized.
2 - It is no longer necessary to contain the error.vue file insidelayouts, because it is not a layout. (We could keep to not contain breaking change)
3 - We could customize each type of error in each corresponding file, without the need to create conditions.

What does the proposed changes look like?

Create a new directory in root errors to work with errors.
Within this new directory contains the components (pages) for type of error.

Example structure:

- errors
    - 404.vue
    - 500.vue
    - ...
- layouts
- pages
- ...

What do you think? A PR would be welcome?

kpturner

kpturner posted a new question

auth-module β€’ 13 hours ago

Trying to use example project out of the box but it doesn't work

I need a pointer as I have build a project using the nuxt-auth example as demo's here: https://nuxt-auth.herokuapp.com/

But when I click the login button for a simple local authentication the endpoint seems to be api/api/auth instead of just api/auth.

I am sure it is a simple config issue but being a noob I don't know where it might be. As far as I know I haven't altered anything that is provided in the example.

brandonpittman

brandonpittman posted a new bug report

nuxtent-module β€’ 17 hours ago

bug Nuxtent cannot load pages when @nuxtjs/axios is registered as a module

Version

1.4.1

Reproduction link

https://github.com/brandonpittman/nuxtent-module/blob/master/examples/multiple-content-types/nuxt.config.js

Steps to reproduce

Add '@nuxtjs/axios' to nuxt.config.js

What is expected ?

Should display content files

What is actually happening?

Can't find page

JacobWay

JacobWay posted a new question

nuxt.js β€’ 18 hours ago

do not lose url parameter in the entire site when one url has the parameter.

Do not lose the url parameter in the entire site when one url has the parameters. For example, a url has a parameter like this: some.url?akey=avalue, then attach the parameter to all urls in the site, like below: then.url?akey=avalue. How can I achieve this?

brandonpittman

brandonpittman posted a new bug report

hare β€’ 18 hours ago

bug Nuxtent cannot load pages when @nuxtjs/axios is registered as a module

Version

v0.4.0

Reproduction link

https://github.com/brandonpittman/nuxtent-module/blob/master/examples/multiple-content-types/nuxt.config.js

Steps to reproduce

Add '@nuxtjs/axios' to nuxt.config.js

What is expected ?

Should display content files

What is actually happening?

Can't find page

hirohirodao

hirohirodao posted a new bug report

docs β€’ 18 hours ago

bug Improve Tasks on Specific Hooks in Modules Guide

Version

2.2

Reproduction link

https://nuxtjs.org/guide/modules/#run-tasks-on-specific-hooks

Steps to reproduce

This is Doc's issue.
Ref: https://nuxtjs.org/guide/modules/#run-tasks-on-specific-hooks

What is expected ?

//before or done, ....
this.nuxt.hook('build:before', async builder => {})
//before or done, ....
this.nuxt.hook('generate:before', async generator => {})

What is actually happening?

this.nuxt.hook('build', async builder => {})

this.nuxt.hook('generate', async generator => {})
enjoyZhou

enjoyZhou posted a new question

proxy-module β€’ 21 hours ago

Proxy page will JavaScript heap out of memory

The first visit page will be successful, but this bug will occur when refreshing the page.
If the proxy's page size is too large, it will out of memory.

code:

// vue code
<iframe frameborder="0" width="100%" height="100%"
   src="/test/page"
   id="aFrame"></iframe>

// nuxt.config.js code
proxy: [
  ['/test/page', { target: 'http://github.com/nuxt-community/proxy-module', },],
  ],

err:

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
sangemi

sangemi posted a new question

blog-module β€’ a day ago

How to change default port

I start some app through some port.
package.json is like this.
"scripts": {
"dev": "nuxt -p=4400",
…

So after i installed blog module, i have to chage blog-module.js etc like this.

export default function NuxtModule(options) {
  const defaults = {
    base: 'http://localhost:4450',      <<<<<<<<<<<<<
    comments: false,
    ...

But this file is in node_modules directory.
Can i change above default port at nuxt.config.js ?

manniL

manniL posted a new feature request

docs β€’ a day ago

idea Improve preprocessor section

What problem does this feature solve?

https://nuxtjs.org/faq/pre-processors#how-to-use-pre-processors-

  • Better examples
  • SASS/LESS/Stylus in the title for better accessibility
  • Better installation guide
Momciloo

Momciloo posted a new question

auth-module β€’ a day ago

How to use twitter strategy provider?

I managed to easily setup facebook login just by following this code example, but setting up the Twitter login in the same way as in the example doesn't work, I'm always getting:

app.js:344 Uncaught TypeError: Cannot read property 'mounted' of undefined

This is my auth setup in nuxt.config.js:

auth: { // Options redirect: { callback: '/callback', login: '/register' }, strategies: { local: { endpoints: { login: { propertyName: 'token.accessToken' } } }, facebook: { client_id: '{secretCode}'', userinfo_endpoint: 'https://graph.facebook.com/v2.12/me?fields=about,name,picture{url},email,birthday', scope: ['public_profile', 'email', 'user_birthday'] }, twitter: { client_id: '{secretCode}', } } }

What am I doing wrong?

Thanks!

cvharris

cvharris posted a new question

axios-module β€’ a day ago

Can I import/require axios from the nuxt module?

I have an Express app and I'd like to use axios to make server-side API calls, apart from Nuxt. Do I have to add axios as it's own dependency or is there a way to const axios = require('@nuxtjs/axios').axios or something similar?

Saw this issue and comment by @clarkdo which hinted that it was possible but may not be implemented

NoClipDigital

NoClipDigital posted a new bug report

nuxt.js β€’ a day ago

bug Validating publicPath value in Nuxt Config [v2.3.1]

Version

v2.3.1

Reproduction link

https://codesandbox.io/s/pxxv9r660

Steps to reproduce

In the build section of the nuxt.config.js file, set the publicPath value to an empty string, or false.

Then re-run npm run dev

What is expected ?

Nuxt should default to /_nuxt/ in the event of an invalid value.

What is actually happening?

If you set it to an empty string, the app starts up as expected, but every page returns a 404 with no client or server side errors messages.

If you set it to false, you receive this error:
url.startsWith is not a function

Additional comments?

In my 2.2.0 build, I had this value set to an empty string for my local environment and an S3 bucket when live.

This worked fine for the last few months. Upon updating, every page of my app 404'd with no explanation.

I tore down the config line-by-line and discovered that the publicPath was causing the issue.

It's fairly clearly stated in the docs that the default value should be /_nuxt/, but since an empty string worked in previous versions, other people who are as foolish as I am might run into this issue.

P4sca1

P4sca1 posted a new question

nuxt.js β€’ a day ago

Changing vuex store data in asyncData after navigating causes previous page to error

This is what happens:

  1. Page 1 is currently rendered and uses data from the vuex store that was previously fetched via api.
  2. We are navigating to page 2 via this.$router.push.
  3. Page 2 has an asyncData method that reloads the data and updates the vuex store.
  4. Page 1 errors when data that is currently rendered is removed from vuex store (because page 2 asyncData is called before page 1 is destroyed).

Does anybody have an idea on how this can be solved?

gianniskarmas

gianniskarmas posted a new question

nuxt.js β€’ a day ago

current state of passing props in nuxt-link?

Using nuxt 2.3.1 and have configured nuxt.config with:

    router: {
        extendRoutes(routes) {
            // Automatically map all route params to component props:
            const appendPassProps = function(rs) {
                for (const route of rs) {
                    route.props = /:/.test(route.path)
                    if (route.children) {
                        appendPassProps(route.children)
                    }
                }
            }
            appendPassProps(routes)
            return routes
        },
    }

Now I have in .nuxt/router.js:

      path: "/products/:category/:productdetails?",
      component: _5ec329d9,
      props: true,
      name: "products-category-productdetails"

This can be done with router-link and named routes like in https://router.vuejs.org/guide/essentials/named-routes.html but even though I have tried any possible combination and reading all examples I could find data still don't pass down to child pages like it does with vue alone.

Many Thanks

kemalcany

kemalcany posted a new question

nuxt.js β€’ a day ago

Has the 2.3.1 update made dev console output (via webpackbar) silent?

Hi there!

Since the 2.3.1 update, I've stopped getting console logs in my terminal during nuxt (ie nuxt dev).
The build command however displays webpackbar status very nicely..

I was just wondering if this is a bug that only I am having or if there is a change in the way nuxt dev now works

Thanks for the help!