Unexpected token error from Regions plugin on 5.0.0
See original GitHub issueWavesurfer.js version(s):
5.0.0
Browser and operating system version(s):
Firefox 88, macOS Big Sur
Code needed to reproduce the issue:
Next.js v10.1.3.
const regions = RegionsPlugin.create({});
const plugins = [regions];
...
wavesurfer.current = WaveSurfer.create({
container: ref.current,
height: 200,
plugins,
});
Use behaviour needed to reproduce the issue:
I came from 4.6.0 where this isn’t an issue.
./node_modules/wavesurfer.js/src/plugin/regions/region.js 46:47
Module parse failed: Unexpected token (46:47)
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
| this.data = params.data || {};
| this.attributes = params.attributes || {};
> this.showTooltip = params.showTooltip ?? true;
|
| this.maxLength = params.maxLength;
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Nuxt Error: Syntax Unexpected token export after installation
I just checked your issue and it happens when you use element UI with Nuxt. Update your Nuxt configuration like this(Andrew Answer):
Read more >My server Error Unexpected token '<' - Forums - Unraid
This sounds like a CORS error, are you using a reverse proxy? Those are not currently supported. If you look at the ALLOWED_ORIGINS...
Read more >SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
Read more >SyntaxError: Unexpected token '<' on new build of React
I have a React application and every time I deploy it to digital ocean I'm getting this error SyntaxError: Unexpected token '<', but...
Read more >Error: undefined Unexpected token < in JSON at position 0 ...
The only way to be certain that it is not the case is to just enable a default theme for a few min,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok fair enough, thanks for your help.
Thanks @caugner. I do have the types installed, and for just
WaveSurfer
things work and I get the media element.I started using the imports based on the jest test (to add plugins), and ran into the nullish operator error at the top of this issue. Doing some more reading last night I think I’m running into this issue. I’m going to test some of the suggestions there, but I may have to customize babel a bit to get this all working. Thanks for the links!