Home

Issue: 1117

hyphen in script causes error

[issue link]

I’m using Nuxt with Snipcart. Snipcart requires you to include their script tag in the head. I receive an error as a result of the “-” in data-api-key. If I remove the hyphens, then I can compile fine.

`Syntax Error: Unexpected token, expected , (45:85)

43 | head: {
44 | script: [

45 | { src: ‘https://cdn.snipcart.com/scripts/2.0/snipcart.js’, id: ‘snipcart’, data-api-key: ‘APIKey’ }
| ^
46 | ]
47 | },
48 | layout: ‘default’,`

This question is available on Nuxt.js community (#c979)