2

I have a script with imports.

I am getting an error on the very first one.

It's not a 404 but a

plyr.js:8 
Uncaught SyntaxError: Unexpected identifier

The modules are on the correct path.

Heres the code that crashes:

// ==========================================================================
// Plyr
// plyr.js v3.4.3
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================

import captions from './captions';
........

Pretty much a newbie on modules so I'm not sure where to make adjustments.

1
  • Scripts don't use import syntax Commented Sep 9, 2018 at 23:25

2 Answers 2

1

You need to be using the scripts built on dist not the ones on src. The project uses gulp to build the files needed for the browser. You can build them yourself, if you find yourself on a branch without an updated dist folder:

npm run build

You need to download its dev dependencies though.

Sign up to request clarification or add additional context in comments.

Comments

0

i think the right path is

    import captions from '.src/js/captions';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.