Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React-player error when minified #1746

Open
saidelimam opened this issue Feb 23, 2024 · 7 comments
Open

React-player error when minified #1746

saidelimam opened this issue Feb 23, 2024 · 7 comments

Comments

@saidelimam
Copy link

here's the error:

Unexpected Application Error!
Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

My Vite minify config:

minify: 'terser',
terserOptions: {
compress: {
    drop_console: isProduction && !isPreview,
    drop_debugger: true, 
    passes: 3, 
    reduce_funcs: true,
    reduce_vars: true, 
},
format: {
    comments: false, 
    wrap_iife: true,
},
mangle: {
    properties: {
	    regex: /^_/, // 
    },
},
ecma: 2020,
module: true,
toplevel: true,
safari10: true,
},
@saidelimam
Copy link
Author

It looks like it's related to CJS module export on a ESModule Vite project. Is there a chance to have an ESM package of react-player?

@thdebay
Copy link

thdebay commented Feb 27, 2024

Which version of Vite are you using? I had the same issue with Vite v2, upgrading to v3 seems to have solved the issue for me.

@saidelimam
Copy link
Author

Which version of Vite are you using? I had the same issue with Vite v2, upgrading to v3 seems to have solved the issue for me.

I'm on Vite version 5.0.11

@floodofstatic
Copy link

I also had this problem come up recently (Vite v3).

Downgrading react-player from 2.14.1 to 2.13.0, the most recent previous version we had installed (upgrading seems to be the point where it stopped working) has resolved it.

Not sure if using 2.15.x will fix it, but don't have the time to test right now.

@luwes
Copy link
Collaborator

luwes commented Mar 6, 2024

could you provide a Codesandbox reproduction online? that will make it easier to debug. thank you!

@LydiaF
Copy link

LydiaF commented Apr 13, 2024

Downgrading from 2.16 to 2.13 worked with Vite for us with this error:

error during build:
Error: [commonjs--resolver] invalid import "import(
/* webpackIgnore: true */
${sdkUrl}
)". It cannot be statically analyzed. Variable dynamic imports must start with ./ and be limited to a specific directory. For example: import(./foo/${bar}.js).
file: /Users/lydia/code/elka/csvite/node_modules/react-player/lib/players/Mux.js

@luwes
Copy link
Collaborator

luwes commented Apr 20, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants