nuxt-seomatic-meta icon indicating copy to clipboard operation
nuxt-seomatic-meta copied to clipboard

Syntax Error: Unexpected token, expected ","

Open toddpadwick opened this issue 3 years ago • 3 comments

When adding nuxt-seomatic-meta to modules I get this unexpected token error which seems to be coming from the plugin chunk itself:

 ERROR  in ./.nuxt/lib.plugin.6ae22825.js                                                                                                                                   friendly-errors 16:45:59

Syntax Error: Unexpected token, expected "," (90:20)                                                                                                                        friendly-errors 16:45:59

  88 |       ? Object.values(metaTagContainer).reduce(
  89 |           {
> 90 |             if (next.name === 'description') {
     |                     ^
  91 |               // Override description tag with updated description
  92 |               next.hid = 'description';
  93 |             }

                                                                                                                                                                            friendly-errors 16:45:59
 @ ./.nuxt/index.js 32:0-92 379:25-63 385:19-57
 @ ./.nuxt/client.js
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js

This error does not occur when I remove nuxt-seomatic-meta from the modules.

Here is my modules setup:

  modules: [
    '@nuxtjs/apollo',
    '@nuxtjs/style-resources',
    'nuxt-i18n',
    '@nuxtjs/axios',
    'nuxt-seomatic-meta'

  ],

and here is the code I am using:

head() {
      return this.headData;
  },

  async asyncData (context) {
      const siteId = context.app.i18n.locale;
      return {
          headData: await context.app.seomaticMeta(context.route, siteId),
      }
  },

toddpadwick avatar Feb 05 '21 15:02 toddpadwick