Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module parse failed: Unexpected token (9:12) in @rabota/analytics-layer/src/index.js #1

Open
RomanNagornyi opened this issue Mar 11, 2019 · 1 comment

Comments

@RomanNagornyi
Copy link

RomanNagornyi commented Mar 11, 2019

dep:
"npm": "^6.5.0",
"nuxt": "^2.3.4",

Hello

I have the next error while running npm run build:

ERROR in ./node_modules/@rabota/analytics-layer/src/layer.js 9:12
Module parse failed: Unexpected token (9:12)
You may need an appropriate loader to handle this file type.
| * @Private
| */

_provider = '';
|
| /**
@ ./node_modules/@rabota/analytics-layer/src/index.js 3:0-24 3:0-24
@ ./node_modules/@rabota/analytics-layer/index.js
@ ./.nuxt/yandex-metrika.plugin.68a5ea40.js
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi ./.nuxt/client.js

Nuxt config file contains such code :

['@rabota/yandex-metrika',
      [{
        counter: 527xxxxx,
        options: {
          defer: true, // required by single page applications
          webvisor: true,
          clickmap: true,
          trackLinks: true,
          accurateTrackBounce: true,
        },
        noscript: true, // insert `noscript` content for each counter
        logging: true, // logs all events to each counter
        development: true
      }]
    ]

Maybe you know how to fix it.

Thanks in advance.

@IPRIT
Copy link
Contributor

IPRIT commented Mar 20, 2019

Hello, @RomanNagornyi !

I'm sorry for having kept you waiting for so long. The options you have provided is obsolete. You can find new options in the README.md.

To answer your question, you need to add transpile option to build section of nuxt.config.js

    transpile: [
      '@rabota/analytics-layer',
      '@rabota/yandex-metrika'
    ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants