Activities

bacon-delight

bacon-delight posted a new bug report

modules •

bug Hot Reload doesn't work

Version

2.13.0

Reproduction link

https://github.com/bacon-delight/nuxt-error

Steps to reproduce

  • Run dev server npm run dev
  • Try changing a color, for example, go to /components/layout/navigation/Navbar.vue
  • Change color property on line 17 to black

What is expected ?

The hot reload doesn't work and the color doesn't change until and unless the development server is restarted from the command terminal. Even refreshing the page doesn't work.

What is actually happening?

Hot reload isn't working. Color changes are not reflected.

Additional comments?

I work with Philips and I'm trying to make my team working on a B2C project switch to Nuxt, and this issue is a complete bummer. I am supposed to demo an app shell to my team on Friday, and I cannot move forward if this issue persists.

kaka-ruto

kaka-ruto posted a new question

modules •

Nuxt build unexpected token { at Object.Module._extensions..js (module.js:664:10)

When I run npm run build on a production server, i get

> nuxt build

[fatal] Unexpected token {
  } catch {
  ^

  SyntaxError: Unexpected token {
  at Object.Module._extensions..js (module.js:664:10)
  at Object.Module._extensions..js (module.js:664:10)

   ╭─────────────────────────────────────╮
   │                                     │
   │   ✖ Nuxt Fatal Error                │
   │                                     │
   │   SyntaxError: Unexpected token {   │
   │                                     │
   ╰─────────────────────────────────────╯

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! soko@1.0.0 build: `nuxt build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the soko@1.0.0 build script.
x-range

x-range posted a new feature request

modules •

idea New version of Yandex metrics code

What problem does this feature solve?

Yandex metrics released a new version of the code.
The hit (url, [title [, referer [, params]]]) signature is outdated. It's supported for backward compatibility, but may be deprecated at any time. We strongly discourage using it. (https://yandex.ru/support/metrica/objects/hit.html)
New Code Initialization Information https://yandex.ru/support/metrica/code/counter-initialize.html.

What does the proposed changes look like?

I fixed the code and sent a pull request 363, according to the documentation.

ahdbarjoud

ahdbarjoud posted a new question

modules •

@nuxtjs/markdownit not working with buefy.

Version:

Latest

Link to reproduce:

https://codesandbox.io/s/hidden-brook-8oijt?file=/pages/index.vue

Steps to reproduce:

In the link above. Go to nuxt config, and remove nuxt-buefy. When its done loading, hard refresh the page. As you will see, the markdown for # Hello works just fine. If you add the module back, wait for the page to load, hard refresh, the markdown doesn't work, but something like **Hello** does.

cron13

cron13 posted a new bug report

modules •

bug @nuxtjs/component-cache - cannot hydrate when use new fetch() in component

Version

2.12

Reproduction link

https://codesandbox.io/s/modest-blackwell-uvtxt

Steps to reproduce

go to https://codesandbox.io/s/modest-blackwell-uvtxt and reload project browser few times

What is expected ?

cache works properly

What is actually happening?

got error Mismatching childNodes vs. VNodes:

gnuletik

gnuletik posted a new question

modules •

markdownit v1.2.8 typo: Object.asign is not a function

The v1.2.8 has a critical issue which make markdownit unusable.

There is a typo in the the following PR : https://github.com/nuxt-community/modules/pull/348
It should be Object.assign instead of Object.asign.

htdinh13

htdinh13 posted a new question

modules •

Google-Tag-manager push datalayer variable value

How can we push event to update GTM datalayer variable value by using '@nuxtjs/gtm' ?
Following is GTM snippet code:
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'userId' : '1234567' //this number must be replaced with an actual User ID
})
<script>
DataLayerVariable.png

DasarathanSampath

DasarathanSampath posted a new question

modules •

Import pre-built R-markdown HTML files

I am using RMarkdown that renders Markdown into html files. I want to serve these entirely built html pages within the app. Upon that, I want to preserve the Navbar and Footer components while serving these html files. Any idea how this can be done with Nuxt Js? If there is any small working example, I would appreciate it.

artemmelnik

artemmelnik posted a new question

modules •

Yandex Metrica not working

image
The counter for the robot is displayed incorrectly!

MoonCheung

MoonCheung posted a new question

modules •

markdown-it:Cannot use highlighting

After I installed @nuxtjs/markdownit or highlight.js, I wrote markdown and highlight.js Settings from the nuxt.config.js configuration file, and the page opened without highlighting when running, I don't know what I did wrong, could you help me solve the problem to make it work

nuxt.config.js:

module.exports = {
...omit
css: [
    'normalize.css/normalize.css',
    'highlight.js/styles/monokai-sublime.css',
    '@/assets/styles/index'
  ],
...omit

modules: [
    '@nuxtjs/markdownit',
],
/**
 * markdown config
 */
markdownit: {
    html: true,
    breaks: true,
    linkify: false,
    injected: true,
    xhtmlOut: true,
    langPrefix: 'md-',
    // 高亮显示
    highlight: function(str, lang) {
      const hljs = require('highlight.js');
      if (lang && hljs.getLanguage(lang)) {
        try {
          return '<pre class="hljs"><code>' +
            hljs.highlight(lang, str, true).value +
            '</code></pre>';
        } catch (__) {}
      }
      // 如果没有语言设置,则显示为纯文本
      return '<pre class="hljs"><code>' + hljs.highlight('plaintext', str, true).value + '</code></pre>'
    }
  },
...omit

There is also a page from which you can see code that still displays language-javascript:

<div class="content" data-v-816e8e8e="">
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quae voluptatibus aperiam odit sequi corporis ab numquam, dignissimos odio! Veniam, sapiente. Vitae perferendis iure nesciunt, nam voluptate voluptatum tempora earum.Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quae voluptatibus aperiam odit sequi corporis ab numquam, dignissimos odio! Veniam, sapiente. Vitae perferendis iure nesciunt, nam voluptate voluptatum tempora earum.😳😓</p>
  <pre>
    <code class="language-javascript"><script src="../../test/test.js">findOne</script&gt</code>
  </pre>
</div>
Drodevbar

Drodevbar posted a new question

modules •

[@nuxtjs/google-tag-manager] <noscript> tag appends to <head> instead of <body>

I am currently using @nuxt-js/google-tag-manager in version 2.3.1. The source code comments say that <noscript> fallback will be appended right after <body> tag, but actually it is appended somewhere inside <head></head> tags. Is this behaviour intended?

Demo: https://codesandbox.io/s/sad-water-ci9xt

monodyle

monodyle posted a new question

modules •

@nuxtjs/markdownit plugin markdown-it-anchor log error

markdownit version: 1.2.7

I've tried to add markdown-it-anchor plugin following markdown-it-attrs and markdown-it-div, but console throw back an error:

error TypeError: plugin.apply is not a function
    at MarkdownIt.push../node_modules/markdown-it/lib/index.js.MarkdownIt.use (vendors.app.js:71757)
    at app.js:2459
    at _callee2$ (app.js:2330)
    at tryCatch (commons.app.js:4525)
    at Generator.invoke [as _invoke] (commons.app.js:4751)
    at Generator.prototype.<computed> [as next] (commons.app.js:4577)
    at asyncGeneratorStep (commons.app.js:31)
    at _next (commons.app.js:53)

nuxt.config.js

  /*
   ** Nuxt.js modules
   */
  modules: [
    '@nuxtjs/markdownit'
  ],
  markdownit: {
    injected: true,
    preset: 'default',
    html: true,
    linkify: true,
    breaks: true,
    use: [
      'markdown-it-div',
      'markdown-it-attrs',
      'markdown-it-anchor',
    ],
    highlight: (str, lang) => {
      const hljs = require('highlight.js');
      if (lang && hljs.getLanguage(lang)) {
        try {
          return '<pre class="hljs"><code>' +
                  hljs.highlight(lang, str, true).value +
                  '</code></pre>';
        // eslint-disable-next-line no-empty
        } catch (__) {}
      }
      return '<pre class="hljs"><code>' +  hljs.highlight('plaintext', str, true).value + '</code></pre>';
    },
  },
memic84

memic84 posted a new question

modules •

[Google Tag Manager] possible to load the vars async

I am using runtime vars for my project, where the vars get loaded on nuxt start.
The Google Tag Manager module won't build the module, if there is no ID set.
The problem is that i don't have any .env files when the build is occurring, but only when the deployments starts.

Is it possible to load the vars async, of make the ID optional during the build?
I want to be able to use the module in universal mode (ssr), with runtime vars.

LuXDAmore

LuXDAmore posted a new bug report

modules •

bug @nuxt/browserconfig - Change the static dir

Version

v2.10.2

Reproduction link

https://github.com/nuxt-community/modules/blob/master/packages/browserconfig/index.js

Steps to reproduce

path.resolve(this.options.srcDir, 'static', browserconfigFileName) and content: '/' + browserconfigFileName, these paths should be taken from the Dir property.

What is expected ?

Put the file (and the path) in the right directory.

What is actually happening?

Always put the file in the /static folder.

nachogarcia

nachogarcia posted a new bug report

modules •

bug Google Tag Manager needs Jquery

Version

latest

Steps to reproduce

Install the module, add the ID and start the app.

What is expected ?

The module works properly

What is actually happening?

It breaks because it needs Jquery

VM9248:1 Uncaught ReferenceError: jQuery is not defined
    at sender (<anonymous>:1:37)
    at <anonymous>:1:316
    at gtm.js?id=GTM-******&l=dataLayer:4683
    at c (gtm.js?id=GTM-******&l=dataLayer:4685)
    at Ab (gtm.js?id=GTM-******&l=dataLayer:4487)
    at e (gtm.js?id=GTM-******&l=dataLayer:4531)
    at gtm.js?id=GTM-******&l=dataLayer:4476
    at Array.<anonymous> (gtm.js?id=GTM-******&l=dataLayer:4532)
    at Object.bg (gtm.js?id=GTM-******&l=dataLayer:4531)
    at Oe (gtm.js?id=GTM-******&l=dataLayer:4532)

Looks like GTM needs jQuery to work. Maybe we should put it as a peer dependency.

Additional comments?

I'm also using https://github.com/nuxt-community/analytics-module and it works flawlessly.

Panksi

Panksi posted a new question

modules •

Nuxtjs/toast: How to pass message to globally configured toast module

How to pass message to globally configured toast module?

In my nuxt file I have:
modules: [ // Doc: https://axios.nuxtjs.org/usage '@nuxtjs/axios', '@nuxtjs/toast', '@nuxtjs/eslint-module' ], toast: { position: 'top-right', register: [ // Register custom toasts { name: 'my_error', options: { type: 'error', theme: 'bubble', duration: '7000' } } ] },

and I tried passing the message with:

updateApplication(fields) { ApplicationService.updateApplication(this.application.app_id, fields) .catch((e) => this.$toast.global.my_error(e)) },

what am I missing here?

memic84

memic84 posted a new question

modules •

Google Tag Manager vars on runtime

We are using the universal mode, import the env vars on runtime. Therefore we don't use any baked in vars during the build.
It seems that when the GTM module gets baked in, during the build and that's not possible to use runtime vars.

Is there a way, of using runtime vars with the module? I did see in the code, that if GTM_ID is not set, the module won't be inserted.

9137

9137 posted a new question

modules •

How do I override GTM event object for page tracking?

Any idea how do I supply the to.gtm value passed in the line linked below? I tried modifying the to object by hooking onto beforeRouteEnter in a component but the value doesn't seem to get through.

https://github.com/nuxt-community/modules/blob/24427eb4dce4e516a68e6523297d3375a024df0b/packages/google-tag-manager/plugin.js#L24

shuyanzi

shuyanzi posted a new question

modules •

query参数有什么用?

what's the following params means?

pageTracking: false,
pageViewEventName: 'nuxtRoute',
respectDoNotTrack: false,
query: {
// query params…
gtmauth: '…', gtmpreview: '…',
gtmcookieswin: '…'
},

Jones-S

Jones-S resolved the question #c170

modules •

Google Tag Manager – Track only with Opt-In

Indeed it was because I had to use actual cookies.
Then it should work.
Also it was necessary to push an event manually which the module normally does on each routechange. (I just trigger it as soon as the user opts-in)