basculantetank
basculantetank

Reputation: 85

How can I use Wavesurfer.js plugins in a React Typescript App?

I am trying to use the Wavesurfer.js plugins in my React Typescript application. When I try to import the plugins, I keep getting "module not found: can't resolve" error. I'm guessing this has something to do with defining the types for the plugins. Does anyone know how I could use these plugins in React Typescript?

import React from "react";
import WaveSurfer from "wavesurfer.js";
import CursorPlugin from "wavesurfer.cursor.js";

Upvotes: 2

Views: 1579

Answers (1)

Željko Mitrović
Željko Mitrović

Reputation: 194

Try

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

Upvotes: 4

Related Questions