Wavesurfer.js: Failed to compile CursorPlugin

Created on 19 Nov 2019  Â·  2Comments  Â·  Source: katspaugh/wavesurfer.js

Helo!
First sorry for my english and thanks for making this tool available.

I use the wavesurfer.js in my vue project. This is instaled with npm.
The wavesurfer is work just with a little problem in load the waveform for some audios.

But my realy probelm is with CursorPlugin.
On add import CursorPlugin from 'wavesurfer.js/src/plugin/cursor.js' in my component, return this:

Failed to compile.

./node_modules/wavesurfer.js/src/plugin/cursor.js 71:18
Module parse failed: Unexpected token (71:18)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| * @type {CursorPluginParams}
| */

defaultParams = {

| hideOnBlur: true,
| width: '1px',

I tried add import CursorPlugin from 'wavesurfer.cursor.js' but not exist wavesurfer.cursor in node_modules
Exists other way to use CursorPlugin in my vue.js project?
Thanks!

  • [x] I have checked the FAQ and it doesn't solve my problem.
  • [x] I have checked the documentation and it doesn't solve my problem
  • [x] I have searched for already open issues which desribe my problem.
  • [ ] The issue I'm having is related to and caused by wavesurfer.js, not by other software (which maybe packages and uses wavesurfer incorrectly) – In that case you should open the issue on the respective project pages.

Please make sure you provide the following information (if applicable):

Wavesurfer.js version(s):

3.2.0

Browser and operating system version(s):

Ubuntu 18.10 and Crhome 78.0.3904.87

Code needed to reproduce the issue:

I'm not allowed to publish

Use behaviour needed to reproduce the issue:

import CursorPlugin from 'wavesurfer.js/src/plugin/cursor.js' in vue.js component

question

Most helpful comment

Import it from dist instead:

import CursorPlugin from 'wavesurfer.js/dist/plugin/wavesurfer.cursor.js'

All 2 comments

Import it from dist instead:

import CursorPlugin from 'wavesurfer.js/dist/plugin/wavesurfer.cursor.js'

Importe-o de dist em vez disso:

import CursorPlugin from 'wavesurfer.js/dist/plugin/wavesurfer.cursor.js'

Thanks!
It worked

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  Â·  6Comments

joshsmith picture joshsmith  Â·  3Comments

Gabrielfcs picture Gabrielfcs  Â·  3Comments

SGDAT picture SGDAT  Â·  3Comments

sebhoff picture sebhoff  Â·  4Comments