Home

Issue: 1788

SyntaxError: Unexpected token - in nuxt.config.js

[issue link]

How do we add custom elements into nuxt.config.js for javascript?


        data-chownow-company-id: 'XXX'
            ^

SyntaxError: Unexpected token -
 at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:588:28)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Module.require (module.js:568:17)


// nuxt.config.js
    script: [
      {
        src: 'https://cf.chownowcdn.com/latest/static/integrations/ordering-modal.min.js',
        data-chownow-company-id: 'XXX'
      }
    ]
This question is available on Nuxt.js community (#c1603)