ERROR in reactPlayerDailyMotion.js from Terser
See original GitHub issueCurrent Behavior
Building with webpack results in error messages:
ERROR in reactPlayerDailyMotion.js from Terser
Unexpected token: punc (:) [reactPlayerDailyMotion.js:3,9]
ERROR in reactPlayerFacebook.js from Terser
Unexpected token: punc (:) [reactPlayerFacebook.js:3,9]
ERROR in reactPlayerFilePlayer.js from Terser
Unexpected token: punc (:) [reactPlayerFilePlayer.js:3,9]
ERROR in reactPlayerMixcloud.js from Terser
Unexpected token: punc (:) [reactPlayerMixcloud.js:3,9]
ERROR in reactPlayerSoundCloud.js from Terser
Unexpected token: punc (:) [reactPlayerSoundCloud.js:3,8]
ERROR in reactPlayerStreamable.js from Terser
Unexpected token: punc (:) [reactPlayerStreamable.js:3,9]
ERROR in reactPlayerTwitch.js from Terser
Unexpected token: punc (:) [reactPlayerTwitch.js:3,9]
ERROR in reactPlayerVidyard.js from Terser
Unexpected token: punc (:) [reactPlayerVidyard.js:3,9]
ERROR in reactPlayerVimeo.js from Terser
Unexpected token: punc (:) [reactPlayerVimeo.js:3,9]
ERROR in reactPlayerWistia.js from Terser
Unexpected token: punc (:) [reactPlayerWistia.js:3,9]
ERROR in reactPlayerYouTube.js from Terser
Unexpected token: punc (:) [reactPlayerYouTube.js:3,8]
ERROR in 12.js from Terser
Unexpected token: punc (:) [12.js:3,8]
Expected Behavior
Compile
Steps to Reproduce
- I’ve installed the new 2.1.1 version (2.0.1 works)
- Imported ReactPlayer the same way as in example (I don’t use any advanced features and let ReactPlayer do all the heavy lifting
import ReactPlayer from 'react-player';
export function VideoPlayer({
url,
volume,
onPlayerStartsPlaying,
}) {
return (
<div class="fixed">
<ReactPlayer
width="100%"
height="100%"
url={url}
playing
volume={volume}
onStart={onPlayerStartsPlaying}
/>
</div>
);
}
Environment
No bundle output so no browser or url passed in for testing webpack: 4.42.1 react-player: 2.1.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
ERROR in reactPlayerDailyMotion.js from Terser #912 - GitHub
Current Behavior Building with webpack results in error messages: ERROR in reactPlayerDailyMotion.js from Terser Unexpected token: punc ...
Read more >Debugging Story: Build failed, error from Terser - Tan Li Hau
It all started with an error message during the build: 'ERROR in bundle.xxx.js from Terser'.
Read more >ERROR in main.js from Terser when compiling with webpack
RESOLVED: This was an error with assignment where I was assigning process.end.NODE_ENV to a string, which was being compiled into two string ...
Read more >Resolving "Failed to minify the bundle" Errors - CircleCI Support
TerserWebpackPlugin. The following error message is usually related to running out of memory during a job: Failed to minify the bundle.
Read more >terser-webpack-plugin | Yarn - Package Manager
Fast, reliable, and secure dependency management.
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
You should not have this issue in
2.2.0
. The lazy loading version withimport()
statements is now opt-in and imported usingreact-player/lazy
.Yeah,
2.1.0
tried to “fix” lazy loaded players by no longer transformingimport()
statements intorequire()
statements (which rendered lazy loading useless). Unfortunately it breaks for any build pipeline that doesn’t supportimport()
statements or the chunks they produce (like yours, or this one).I’m going to release
2.2.0
shortly that reverts the mainreact-player
import to how things were in2.0.1
, which should fix most problems for most users. Then, if your build system supportsimport()
statements you can import fromreact-player/lazy
.