Activities

teleyinex

teleyinex posted a new bug report

modules •

bug Vuetify toolbar changes its size when reloading

Version

last

Reproduction link

https://www.npmjs.com/package/@nuxtjs/vuetify

Steps to reproduce

Basically create a project choosing vuetify as the framework. Then, run yarn run dev and wait for the server to start. When it has started reload the page several times, you will see that the toolbar changes its size, bumping.

What is expected ?

The toolbar should not change its size.

What is actually happening?

The toolbar changes its size.

clstudio

clstudio posted a new question

modules •

@nuxt/vuetify with nuxt-i18n: Vuetify translations not showing

Hi, how is it possible to use the built-in vuetify translations (like for datatables) https://vuetifyjs.com/en/framework/internationalization#vue-i18n with nuxt? I'm using @nuxtjs/vuetify and nuxt-i18n, all latest. Vuetify and i18n by itself work perfectly fine.

For instance, I tried the following in nuxt.config:

vueI18n: {
          fallbackLocale: 'en',
          messages: {
            fr: {
              welcome: 'Bienvenue',
              $vuetify: {
                dataIterator: {
                    rowsPerPageText: 'Élements par page:',
                    rowsPerPageAll: 'Tous',
                    pageText: '{0}-{1} de {2}',
                    noResultsText: 'Aucun enregistrement correspondant trouvé',
                    nextPage: 'Page suivante',
                    prevPage: 'Page précédente'
                },
                dataTable: {
                    rowsPerPageText: 'Lignes par page:'
                },
                noDataText: 'Aucune donnée disponible'
              },
brandonpittman

brandonpittman posted a new question

modules •

Expected behavior with .md files as routes doesn't work with markdownit module

<template lang="md> works as expected. The README claims you can use .md files as well, however, pages/hello.md doesn't seem to get converted to a route. Am I oversimplying its usage?</p>

manniL

manniL posted a new feature request

modules •

idea Deprecate optimize-module

What problem does this feature solve?

https://www.npmjs.com/package/@nuxtjs/optimize is obsolete but still normally listed on NPM.

acan13

acan13 posted a new question

modules •

@babel/polyfill and intersection-observer installation errors

I'm trying to simply install the @babel/polyfill and intersection-observer polyfills on my nuxt app and keep running into different bugs. I've looked all over for instructions and answers but can't find anything that's solved.

Steps I followed:

I used npm install to install @babel/polyfill and intersection-observer.

I added module.exports.build.transpile = [ /.(js|vue)$/ ]

I ran npm run dev

Error logs:

Multiple variations of "export 'default' (imported as '_typeof') was not found in '@babel/runtime/helpers/typeof'

Any suggestions on what I've done wrong or what I need to do to implement the @babel/polyfill and intersection-observer polyfills?

bskimball

bskimball fixed the bug report #c128

modules •

bug markdownit not working with nuxt-edge
lvaroqui

lvaroqui posted a new question

modules •

Cannot resolve "@nuxtjs/toast'

Hello,

I'm using Nuxt to create my frontend application in which I would like to add Toast.
However after installing following the documentation :

yarn add vue-toasted
add '@nuxtjs/toast' to modules into the nuxt.config.js file

The server cannot build due to this error :

ERROR  Nuxt error
Error: Cannot resolve "@nuxtjs/toast" from "/front/nuxtjs/toast"

I am running nuxt on a docker container but I already installed depencies succesfully such as bootstrap-vue…

Thanks in advance for your help !

aldarund

aldarund posted a new bug report

modules •

bug Google Tag Manager module break clicking on elements when id not set

Version

2.0.0

Reproduction link

-

Steps to reproduce

When id for GTM undefined/not it break whole app. Specifically click events not working for vuetify buttons.
And there a error in console

[nuxt] Error while initializing app Error: [vue-analytics] Missing the "id" parameter. Add at least one tracking domain ID
    at U (vendors.app.js:22408)
    at R (vendors.app.js:22408)
    at Function.Vue.use (commons.app.js:13930)
    at _callee$ (app.js:3663)
    at tryCatch (commons.app.js:4344)
    at Generator.invoke [as _invoke] (commons.app.js:4582)
    at Generator.prototype.(anonymous function) [as next] (http://localhost:3000/_nuxt/commons.app.js:4396:21)
    at asyncGeneratorStep (commons.app.js:46)
    at _next (commons.app.js:68)
    at commons.app.js:75

I dont really need GTM during E2E tests, and neither want to launch them in dev mode.

What is expected ?

warning in console at most

What is actually happening?

error in console and click

janzheng

janzheng posted a new bug report

modules •

bug Markdownit injected=true option prevents plugins from running

Version

latest

Reproduction link

https://github.com/nuxt-community/modules/tree/master/packages/markdownit

Steps to reproduce

Create a new vue template page with:

<template lang="md">

This is a title{.bold}

</template>

Nuxt config:

markdownit: {
injected: true, // commented out to allow attrs in lang="md" blocks
use: [
'markdown-it-attrs',
],
},

What is expected ?

Expected output:

This is a title

What is actually happening?

Current output when injected is set to true is this:

This is a title{.bold}

But plugins still work when using $md.render, so $md.render("# This is a title{.bold}") still outputs expected output.

If injected is set to false, everything works as expected, and the plugins work.

Additional comments?

I dug through the code and found the culprit. In @nuxtjs/markdownit/index.js:

  if (_options.injected === true) {
    delete _options.injected
    // Register plugin
    this.addPlugin({
      src: path.resolve(__dirname, 'plugin.js'),
      fileName: 'markdown-it.js',
      options: _options // <--- this needs an object assignment: Object.assign({}, options, this.options.markdownit)
    })
  }

options: _options needs an object assignment because in plugin.js, you perform a .shift() on options in the for of loop that gets rid of the plugins and prevents them from being rendered properly.

janzheng

janzheng posted a new bug report

modules •

bug Markdownit injected=true option prevents plugins from running

Version

latest

Reproduction link

https://github.com/nuxt-community/modules/tree/master/packages/markdownit

Steps to reproduce

Create a new vue template page with:

<template lang="md">

This is a title{.bold}

</template>

Nuxt config:

markdownit: {
injected: true, // commented out to allow attrs in lang="md" blocks
use: [
'markdown-it-attrs',
],
},

What is expected ?

Expected output:

This is a title

What is actually happening?

Current output when injected is set to true is this:

This is a title{.bold}

But plugins still work when using $md.render, so $md.render("# This is a title{.bold}") still outputs expected output.

If injected is set to false, everything works as expected, and the plugins work.

Additional comments?

I dug through the code and found the culprit. In @nuxtjs/markdownit/index.js:

  if (_options.injected === true) {
    delete _options.injected
    // Register plugin
    this.addPlugin({
      src: path.resolve(__dirname, 'plugin.js'),
      fileName: 'markdown-it.js',
      options: _options // <--- this needs an object assignment: Object.assign({}, options, this.options.markdownit)
    })
  }

options: _options needs an object assignment because in plugin.js, you perform a .shift() on options in the for of loop that gets rid of the plugins and prevents them from being rendered properly.

paulgv

paulgv resolved the question #c132

modules •

Google Tag Manager - dataLayer net::ERR_ABORTED
besnikh

besnikh posted a new question

modules •

Google Tag Manager - dataLayer net::ERR_ABORTED

Hi,
I just installed Google Tag Manager module, and managed to track GA Pageviews, when I disabled the Preview mode I am getting this error in my console:
GET http://www.googletagmanager.com/gtm.js?id=GTMxxxxx&l=dataLayer net::ERR_ABORTED

I tried to do the following nuxt.conf

FareheSoheil

FareheSoheil posted a new question

modules •

Can't add the dependency using yarn
pencilpix

pencilpix posted a new question

modules •

Trying to make JsDoc generate the docs but it always fails because of `ejs` syntax

I build a project using nuxt and I depend on modules allover the app. the issue is when I try to generate documentation that would failed because of ejs template syntax <%= %> which return unexpected syntax error. if anyone can help me how to make jsdoc or any other package like jsdoc works

japboy

japboy posted a new question

modules •

Does google-tag-manager module provide a way to push DataLayer on server side?

My website currently working on transition to Nuxt heavily depends on GTM DataLayer which is set on server side.

Previous implementation of server side templates is like;

<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push(...);
window.dataLayer.push(...);
window.dataLayer.push(...);
</script>

so I have to prepare the dataLayer object before gtm.js is initialized. Does this module provide a way to do so?

Thanks.

bskimball

bskimball posted a new bug report

modules •

bug markdownit not working with nuxt-edge

Version

2

Steps to reproduce

When running @nuxtjs/markdownit with nuxt-edge, the build files with cannot read 'md' of undefined.

× fatal TypeError: Cannot set property 'md' of undefined
  at Builder.extendBuild.config (C:\wamp64\www\bdk-nuxt\node_modules\@nuxtjs\markdownit\index.js:21:39)
  at Builder.<anonymous> (C:\wamp64\www\bdk-nuxt\node_modules\nuxt-edge\dist\nuxt.js:149:23)
  at WebpackClientConfig.config (C:\wamp64\www\bdk-nuxt\node_modules\nuxt-edge\dist\nuxt.js:3017:56)
  at Builder.webpackBuild (C:\wamp64\www\bdk-nuxt\node_modules\nuxt-edge\dist\nuxt.js:3588:56)
  at Builder.build (C:\wamp64\www\bdk-nuxt\node_modules\nuxt-edge\dist\nuxt.js:3299:16)
  at <anonymous>
Nuxt Fatal Error :(

It looks to be when trying to add markdownitLoader to vueLoader in line 22 of index.js. on this command vueLoader.query.loaders['md'] = markDownItLoader. vueLoader.query.loaders is returning as undefined.

What is expected ?

To be able to use markdown files

What is actually happening?

build failure

Domitnator

Domitnator posted a new question

modules •

Bundling a nuxt module

Hi Guys,

I created a nuxt module which makes it easy to do api calls against the kentico-cloud cms: https://github.com/Domitnator/kenticocloud-nuxt-module

I had some struggles but now it all works fine and can installed trough npm: https://www.npmjs.com/package/kenticocloud-nuxt-module

Now i want to take it one step further and implement some basic caching functionality. So i created a CacheService for that which lives in a services folder (The reason I created this in a seperate file is because i want to be able to unit-test it with Mocha. This also works fine.):

folderStructure.PNG

And I am importing it in my plugin template:

import.PNG

But now i am running into problems when i want to use my module in my nuxt webapp:

import2.PNG

It cannot find the cache-service, which makes sense! So my question is: How should i fix this issue?

I thought already of the following options:

  • Bundling: My idea was to bundle the files by using rollupjs (https://rollupjs.org/guide/en). But then I am running into problems with the lodash-template syntax, which rollupjs wont accept.

lodashsyntax.PNG

Also the addPlugin method needs attention. I dont know how to work arround that right now

pathresolve.PNG

  • Concatenate: I could use a npm module to just concatenate the two files (plugin.template.js and cacheService.js). But feels like a hacky solution.

    Hopefully someone can point me in the right direction. I already looked at other nuxt-modules but i couldnt find one which has a solution for this issue.

Zsavajji

Zsavajji posted a new question

modules •

@nuxtjs/toast Not working in server context

Hi,
i'm trying to send a toast into a middleware which checks auth status. I wanted it to set a toast and redirect if the user is not logged, but i get an undefined error on app.$toast. I thought i could access $toast on the context.app, what am i doing wrong?

export default ({ store, app, redirect }) => {
  if(store.getters['user/isUserLogged']) {
    app.$toast.show('Already registered!');
    return redirect({ name: 'homepage' })
  }
}

Thanks

rbwilcoxon11

rbwilcoxon11 posted a new feature request

modules •

idea Exclude markdownIt from vendor

What problem does this feature solve?

Currently, I have a huge bundle size because prism.js is included in my vendor build. I want to avoid the Mb cost…

What does the proposed changes look like?

Essentially, the markdownit component needs to be available to the asyncData instance directly. I was thinking I could just use require in asnycdata—not sure if this will actually work—but if it were an option in the module that would be a lot easier. Some ways to do that are discussed in the nextjs blog post. https://arunoda.me/blog/ssr-and-server-only-modules

I tried the second option but couldn't get it working… maybe someone had success with another one of the options?

Zsavajji

Zsavajji posted a new question

modules •

@nuxtjs/toast - Usage in middleware

Hi,
i'm trying to send a toast into a middleware which checks auth status. I wanted it to set a toast and redirect if the user is not logged, but i get an undefined error on app.$toast. I thought i could access $toast on the context.app, what am i doing wrong?

export default ({ store, app, redirect }) => {
  if(store.getters['user/isUserLogged']) {
    app.$toast.show('Already registered!');
    return redirect({ name: 'homepage' })
  }
}

Thanks