-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(web): removed dynamic shaka-player import #2292
Conversation
added types for shaka-player
I now finally understand the issue. Not sure how to solve it :( |
@Bram-dc , can you describe the issue you're having with the dynamic import? |
Yeah, I will create a sample project! |
@jspizziri https://github.com/Bram-dc/rntp-web-demo shaka-player will be undefined. It is an easy fix by forcing the bundler to transform the shaka file again. See the commented lines in |
I also think this has become an issue because shaka-player is distributed for these modern javascript projects and not a "bug" in RNTP. By importing the file directly bundlers will almost in every case do this extra step automatically. The dynamic import will break the code in specific bundlers. In my projects I use vite as bundler and it has an easy fix for this problem. Maybe other bundlers do not have this options. This problem affects only a very small group of people (react-native-web + rntp + modules), and not worth patching in this library. (shaka-player is the issue because it is not made for these environments). |
@Bram-dc this is interesting... it seems like Vite is doing something wrong. Dynamic imports are part of the JS spec so I'm not sure why it's not doing it properly. Do you have any insights there? (never used vite and I'm old enough to have bundler fatigue at this point haha). When I ran your project, I did notice that something from shaka was importing (specifically |
…on the imported shaka module doublesymmetry#2292
I'm going to close this PR in favor of the one I just opened. In short, I don't think dynamic imports in and of themselves are the issue here. |
…on the imported shaka module doublesymmetry#2292
Let bundlers decide how to import the package instead of forcing a dynamic import.