-
-
Save Security2431/2b28f17e11870bb4b0e347673e16d5ba to your computer and use it in GitHub Desktop.
{ | |
"scripts": { | |
"postinstall": "patch-package" | |
}, | |
"devDependencies": { | |
"patch-package": "6.5.1", | |
"shaka-player": "4.3.4" | |
} | |
} |
diff --git a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts | |
index e8cb5c3..08e6c9a 100644 | |
--- a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts | |
+++ b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts | |
@@ -4468,3 +4468,5 @@ declare namespace ಠ_ಠ.clutz { | |
static isTypeSupported (keySystem : string , contentType : string ) : boolean ; | |
} | |
} | |
+ | |
+export default shaka; | |
\ No newline at end of file | |
diff --git a/node_modules/shaka-player/dist/shaka-player.ui.d.ts b/node_modules/shaka-player/dist/shaka-player.ui.d.ts | |
index 6dbd94e..0ad95ab 100644 | |
--- a/node_modules/shaka-player/dist/shaka-player.ui.d.ts | |
+++ b/node_modules/shaka-player/dist/shaka-player.ui.d.ts | |
@@ -5054,3 +5054,5 @@ declare namespace shaka.extern { | |
declare namespace shaka.extern { | |
type UIVolumeBarColors = { base : string , level : string } ; | |
} | |
+ | |
+export default shaka; | |
\ No newline at end of file | |
diff --git a/node_modules/shaka-player/index.d.ts b/node_modules/shaka-player/index.d.ts | |
new file mode 100644 | |
index 0000000..86130b2 | |
--- /dev/null | |
+++ b/node_modules/shaka-player/index.d.ts | |
@@ -0,0 +1,2 @@ | |
+/// <reference path="./dist/shaka-player.compiled.d.ts" /> | |
+/// <reference path="./dist/shaka-player.ui.d.ts" /> | |
diff --git a/node_modules/shaka-player/ui.d.ts b/node_modules/shaka-player/ui.d.ts | |
new file mode 100644 | |
index 0000000..7471371 | |
--- /dev/null | |
+++ b/node_modules/shaka-player/ui.d.ts | |
@@ -0,0 +1,3 @@ | |
+import shaka from 'shaka-player/dist/shaka-player.ui' | |
+export * from 'shaka-player/dist/shaka-player.ui' | |
+export default shaka; |
@TDUser91 I have to investigate the issue. Can you share the codebase, it'll help me a lot? 🙏
I added a sample repo you can find it here: https://github.com/TDUser91/react_test_drm. Thanks
@TDUser91 What I've found out so far, this is the issue in shaka-player
library. I've tested on the bare shaka-player
library and even upgraded to the [email protected]
version. I have no other solution, try playing around with the tsconfig settings to avoid these warnings
EDIT: added more to the reply
Thank you for taking the time and the replies.
Here's what I've found from my end, I believe the issue is coming from web-pack (or at least that's what I've understood from this issue and this discussion). If you can take a look and confirm that ?
I've added this GENERATE_SOURCEMAP=false
in my .env file and the warnings seems to be gone. I even ran the app in prod with npm run build
My concern now is: does disabling those mapping warnings; will disable all the warnings coming on my project, just those of the node_module or only those of shaka-player ?
What do you think ?
I must add thought, I ran into this issue only with this machine (Linux), when I tried the same code on (Windows, Mac) I didn't have the warnings/errors. But I fail to see how the OS if at all has something to do with this ? (all OSs were running same node, npm and shaka player versions).
Way to go. This is the possible solution webpack ignoring warnings. It will turn off all the node_modules
warnings.
FYI: node_modules
is a self-contained library that we shouldn't tamper with. So, I think it's a good solution 👍
P.S. I've dug into the shaka-player
library and found a lot of errors under the hood 🤫
Thank you for the gist @Security2431! I followed your instructions, but still running into TS errors during compilation:
[build:watch:lib:types:tsc] node_modules/shaka-player/dist/shaka-player.compiled.d.ts:503:62 - error TS2694: Namespace 'google.ima.dai.api' has no exported member 'StreamRequest'. [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] 503 requestServerSideStream (imaRequest : google.ima.dai.api.StreamRequest , backupUrl ? : string ) : Promise < string > ; [build:watch:lib:types:tsc] ~~~~~~~~~~~~~ [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] node_modules/shaka-player/dist/shaka-player.compiled.d.ts:636:37 - error TS2694: Namespace 'google.ima' has no exported member 'Ad'. [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] 636 constructor (imaAd : google.ima.Ad , imaAdManager : google.ima.AdsManager , video : HTMLMediaElement | null ) ; [build:watch:lib:types:tsc] ~~ [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] node_modules/shaka-player/dist/shaka-player.compiled.d.ts:664:45 - error TS2694: Namespace 'google.ima.dai.api' has no exported member 'Ad'. [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] 664 constructor (imaAd : google.ima.dai.api.Ad | null , video : HTMLMediaElement | null ) ; [build:watch:lib:types:tsc] ~~ [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] node_modules/shaka-player/dist/shaka-player.compiled.d.ts:1537:9 - error TS2506: 'AbortController' is referenced directly or indirectly in its own base expression. [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] 1537 class AbortController extends AbortController { [build:watch:lib:types:tsc] ~~~~~~~~~~~~~~~ [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] node_modules/shaka-player/dist/shaka-player.compiled.d.ts:3092:41 - error TS2694: Namespace 'google.ima' has no exported member 'AdDisplayContainer'. [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] 3092 constructor (container : google.ima.AdDisplayContainer ) ; [build:watch:lib:types:tsc] ~~~~~~~~~~~~~~~~~~ [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] node_modules/shaka-player/dist/shaka-player.compiled.d.ts:3097:34 - error TS2694: Namespace 'google.ima' has no exported member 'ImaSdkSettings'. [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] 3097 getSettings ( ) : google.ima.ImaSdkSettings | null ; [build:watch:lib:types:tsc] ~~~~~~~~~~~~~~ [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] node_modules/shaka-player/dist/shaka-player.compiled.d.ts:3176:130 - error TS2694: Namespace 'google.ima.dai.api' has no exported member 'UiSettings'. [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] 3176 constructor (videoElement : HTMLMediaElement | null , adUiElement ? : HTMLElement | null , uiSettings ? : google.ima.dai.api.UiSettings | null ) ; [build:watch:lib:types:tsc] ~~~~~~~~~~ [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] node_modules/shaka-player/dist/shaka-player.compiled.d.ts:3185:55 - error TS2694: Namespace 'google.ima.dai.api' has no exported member 'StreamRequest'. [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] 3185 requestStream (streamRequest : google.ima.dai.api.StreamRequest | null ) : any ; [build:watch:lib:types:tsc] ~~~~~~~~~~~~~ [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] node_modules/shaka-player/dist/shaka-player.compiled.d.ts:3193:29 - error TS2694: Namespace 'google.ima' has no exported member 'ImaSdkSettings'. [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] 3193 let settings : google.ima.ImaSdkSettings ; [build:watch:lib:types:tsc] ~~~~~~~~~~~~~~ [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] node_modules/shaka-player/dist/shaka-player.compiled.d.ts:3596:62 - error TS2694: Namespace 'google.ima.dai.api' has no exported member 'StreamRequest'. [build:watch:lib:types:tsc] [build:watch:lib:types:tsc] 3596 requestServerSideStream (imaRequest : google.ima.dai.api.StreamRequest , backupUrl ? : string ) : Promise < string > ;
Any suggestions?
You should set skipLibCheck
option to true
in your tsconfig.json
file.
diff --git a/dist/shaka-player.compiled.d.ts b/dist/shaka-player.compiled.d.ts
index e6dcbc69da69831c5b327d4ca4a28c4a648caf8a..19c4e9b9d816f5cf12a4e2b8b3d3cf2e326c4e57 100644
--- a/dist/shaka-player.compiled.d.ts
+++ b/dist/shaka-player.compiled.d.ts
@@ -5424,6 +5424,7 @@ declare namespace ಠ_ಠ.clutz {
static isTypeSupported (keySystem : string , contentType : string ) : boolean ;
}
}
+export default shaka;
// Generated from /home/runner/work/shaka-player/shaka-player/externs/webos.js
declare namespace PalmSystem {
let deviceInfo : string ;
diff --git a/dist/shaka-player.ui.d.ts b/dist/shaka-player.ui.d.ts
index 5b3b8753930568a83a6d1d8d6d18357de4d8424a..4301fa807b03741f3384137432cb206df390287b 100644
--- a/dist/shaka-player.ui.d.ts
+++ b/dist/shaka-player.ui.d.ts
@@ -6128,3 +6128,4 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type UIVolumeBarColors = { base : string , level : string } ;
}
+export default shaka;
\ No newline at end of file
diff --git a/index.d.ts b/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..86130b219f20157404545f817f41485ab13ced25
--- /dev/null
+++ b/index.d.ts
@@ -0,0 +1,2 @@
+/// <reference path="./dist/shaka-player.compiled.d.ts" />
+/// <reference path="./dist/shaka-player.ui.d.ts" />
diff --git a/ui.d.ts b/ui.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5118563d30558c6692fd35b4f4bd04b6e8874288
--- /dev/null
+++ b/ui.d.ts
@@ -0,0 +1,3 @@
+import shaka from './dist/shaka-player.ui'
+export * from './dist/shaka-player.ui'
+export default shaka;
diff --git a/dist/shaka-player.compiled.d.ts b/dist/shaka-player.compiled.d.ts
index ba937d653c8927987fc86d28fdac35002baaed8c..164ec3490b0b84551931e3d1afc83d66dfc03ec5 100644
--- a/dist/shaka-player.compiled.d.ts
+++ b/dist/shaka-player.compiled.d.ts
@@ -5108,3 +5108,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type TransmuxerPlugin = ( ) => shaka.extern.Transmuxer ;
}
+
+export default shaka;
diff --git a/dist/shaka-player.ui.d.ts b/dist/shaka-player.ui.d.ts
index b5d4d89cdc6012c3124ee9e93e7f52684df460d4..dfa473f25a185dc03fe8253317fc6676d56285ef 100644
--- a/dist/shaka-player.ui.d.ts
+++ b/dist/shaka-player.ui.d.ts
@@ -5821,3 +5821,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type UIVolumeBarColors = { base : string , level : string } ;
}
+
+export default shaka;
\ No newline at end of file
diff --git a/index.d.ts b/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..86130b219f20157404545f817f41485ab13ced25
--- /dev/null
+++ b/index.d.ts
@@ -0,0 +1,2 @@
+/// <reference path="./dist/shaka-player.compiled.d.ts" />
+/// <reference path="./dist/shaka-player.ui.d.ts" />
diff --git a/ui.d.ts b/ui.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e5c05d687e22014d4ba6bbdd4bf73e62b67b0ad6
--- /dev/null
+++ b/ui.d.ts
@@ -0,0 +1,4 @@
+import shaka from './dist/shaka-player.ui';
+export * from './dist/shaka-player.ui';
+
+export default shaka;
@enjikaka's patch didn't work for me because of different paths so I modified it:
shaka-player+4.11.1.patch
diff --git a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
index ba937d653c8927987fc86d28fdac35002baaed8c..164ec3490b0b84551931e3d1afc83d66dfc03ec5 100644
--- a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
+++ b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
@@ -5108,3 +5108,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type TransmuxerPlugin = ( ) => shaka.extern.Transmuxer ;
}
+
+export default shaka;
diff --git a/node_modules/shaka-player/dist/shaka-player.ui.d.ts b/node_modules/shaka-player/dist/shaka-player.ui.d.ts
index b5d4d89cdc6012c3124ee9e93e7f52684df460d4..dfa473f25a185dc03fe8253317fc6676d56285ef 100644
--- a/node_modules/shaka-player/dist/shaka-player.ui.d.ts
+++ b/node_modules/shaka-player/dist/shaka-player.ui.d.ts
@@ -5821,3 +5821,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type UIVolumeBarColors = { base : string , level : string } ;
}
+
+export default shaka;
\ No newline at end of file
diff --git a/index.d.ts b/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..86130b219f20157404545f817f41485ab13ced25
--- /dev/null
+++ b/node_modules/shaka-player/index.d.ts
@@ -0,0 +1,2 @@
+/// <reference path="./dist/shaka-player.compiled.d.ts" />
+/// <reference path="./dist/shaka-player.ui.d.ts" />
diff --git a/node_modules/shaka-player/ui.d.ts b/node_modules/shaka-player/ui.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e5c05d687e22014d4ba6bbdd4bf73e62b67b0ad6
--- /dev/null
+++ b/node_modules/shaka-player/ui.d.ts
@@ -0,0 +1,3 @@
+import shaka from 'shaka-player/dist/shaka-player.ui'
+export * from 'shaka-player/dist/shaka-player.ui'
+export default shaka;
Has anyone prepared a patch for the latest version? :)
Hi @mevljas, thanks for contributing! I'm surprised to see that there have been so many versions released below. I'm curious, is there a reason why this bug hasn't been fixed yet?
I think it's because Shaka currently doesn't officially support TS and we're all waiting for the official support sometime next year.
Gotchu, let's keep fingers crossed 🤞
shaka-player+4.11.7.patch
diff --git a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
index 19c0930..cc0a3fd 100644
--- a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
+++ b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
@@ -5117,3 +5117,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type TransmuxerPlugin = ( ) => shaka.extern.Transmuxer ;
}
+
+export default shaka;
diff --git a/node_modules/shaka-player/dist/shaka-player.ui.d.ts b/node_modules/shaka-player/dist/shaka-player.ui.d.ts
index 1618ca0..a6076c6 100644
--- a/node_modules/shaka-player/dist/shaka-player.ui.d.ts
+++ b/node_modules/shaka-player/dist/shaka-player.ui.d.ts
@@ -5830,3 +5830,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type UIVolumeBarColors = { base : string , level : string } ;
}
+
+export default shaka;
diff --git a/node_modules/shaka-player/index.d.ts b/node_modules/shaka-player/index.d.ts
new file mode 100644
index 0000000..3ebfd96
--- /dev/null
+++ b/node_modules/shaka-player/index.d.ts
@@ -0,0 +1,2 @@
+/// <reference path="./dist/shaka-player.compiled.d.ts" />
+/// <reference path="./dist/shaka-player.ui.d.ts" />
\ No newline at end of file
diff --git a/node_modules/shaka-player/ui.d.ts b/node_modules/shaka-player/ui.d.ts
new file mode 100644
index 0000000..84a3be0
--- /dev/null
+++ b/node_modules/shaka-player/ui.d.ts
@@ -0,0 +1,3 @@
+import shaka from 'shaka-player/dist/shaka-player.ui'
+export * from 'shaka-player/dist/shaka-player.ui'
+export default shaka;
\ No newline at end of file
Appreciate @ts-sebastjanmevlja
shaka-player+4.11.10.patch
diff --git a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
index 30859d1..a8901ac 100644
--- a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
+++ b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
@@ -5128,3 +5128,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type TransmuxerPlugin = ( ) => shaka.extern.Transmuxer ;
}
+
+export default shaka;
diff --git a/node_modules/shaka-player/dist/shaka-player.ui.d.ts b/node_modules/shaka-player/dist/shaka-player.ui.d.ts
index 04130c8..8892116 100644
--- a/node_modules/shaka-player/dist/shaka-player.ui.d.ts
+++ b/node_modules/shaka-player/dist/shaka-player.ui.d.ts
@@ -5841,3 +5841,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type UIVolumeBarColors = { base : string , level : string } ;
}
+
+export default shaka;
diff --git a/node_modules/shaka-player/index.d.ts b/node_modules/shaka-player/index.d.ts
new file mode 100644
index 0000000..3ebfd96
--- /dev/null
+++ b/node_modules/shaka-player/index.d.ts
@@ -0,0 +1,2 @@
+/// <reference path="./dist/shaka-player.compiled.d.ts" />
+/// <reference path="./dist/shaka-player.ui.d.ts" />
\ No newline at end of file
diff --git a/node_modules/shaka-player/ui.d.ts b/node_modules/shaka-player/ui.d.ts
new file mode 100644
index 0000000..84a3be0
--- /dev/null
+++ b/node_modules/shaka-player/ui.d.ts
@@ -0,0 +1,3 @@
+import shaka from 'shaka-player/dist/shaka-player.ui'
+export * from 'shaka-player/dist/shaka-player.ui'
+export default shaka;
\ No newline at end of file
shaka-player+4.12.4.patch
diff --git a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
index a2248b6..484f115 100644
--- a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
+++ b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
@@ -5156,3 +5156,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type TransmuxerPlugin = ( ) => shaka.extern.Transmuxer ;
}
+
+export default shaka;
\ No newline at end of file
diff --git a/node_modules/shaka-player/dist/shaka-player.ui.d.ts b/node_modules/shaka-player/dist/shaka-player.ui.d.ts
index 4fdbd43..7aa663d 100644
--- a/node_modules/shaka-player/dist/shaka-player.ui.d.ts
+++ b/node_modules/shaka-player/dist/shaka-player.ui.d.ts
@@ -5869,3 +5869,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type UIVolumeBarColors = { base : string , level : string } ;
}
+
+export default shaka;
\ No newline at end of file
diff --git a/node_modules/shaka-player/index.d.ts b/node_modules/shaka-player/index.d.ts
new file mode 100644
index 0000000..3ebfd96
--- /dev/null
+++ b/node_modules/shaka-player/index.d.ts
@@ -0,0 +1,2 @@
+/// <reference path="./dist/shaka-player.compiled.d.ts" />
+/// <reference path="./dist/shaka-player.ui.d.ts" />
\ No newline at end of file
diff --git a/node_modules/shaka-player/ui.d.ts b/node_modules/shaka-player/ui.d.ts
new file mode 100644
index 0000000..84a3be0
--- /dev/null
+++ b/node_modules/shaka-player/ui.d.ts
@@ -0,0 +1,3 @@
+import shaka from 'shaka-player/dist/shaka-player.ui'
+export * from 'shaka-player/dist/shaka-player.ui'
+export default shaka;
\ No newline at end of file
shaka-player+4.13.0.patch
diff --git a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
index 0971e58..9d5c515 100644
--- a/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
+++ b/node_modules/shaka-player/dist/shaka-player.compiled.d.ts
@@ -5266,3 +5266,5 @@ declare namespace shaka.extern {
declare namespace shaka.extern {
type TransmuxerPlugin = ( ) => shaka.extern.Transmuxer ;
}
+
+export default shaka;
diff --git a/node_modules/shaka-player/dist/shaka-player.ui.d.ts b/node_modules/shaka-player/dist/shaka-player.ui.d.ts
index 460e009..41bab00 100644
--- a/node_modules/shaka-player/dist/shaka-player.ui.d.ts
+++ b/node_modules/shaka-player/dist/shaka-player.ui.d.ts
@@ -6011,3 +6011,5 @@ declare namespace shaka.extern {
declare namespace shaka.ui.Watermark {
type Options = { alpha : number , color : string , displayDuration : number , interval : number , position : string , size : number , skip : number , text : string , transitionDuration : number , type : string } ;
}
+
+export default shaka;
diff --git a/node_modules/shaka-player/index.d.ts b/node_modules/shaka-player/index.d.ts
new file mode 100644
index 0000000..79f4829
--- /dev/null
+++ b/node_modules/shaka-player/index.d.ts
@@ -0,0 +1,2 @@
+<reference path="./dist/shaka-player.compiled.d.ts" />
+<reference path="./dist/shaka-player.ui.d.ts" />
\ No newline at end of file
diff --git a/node_modules/shaka-player/ui.d.ts b/node_modules/shaka-player/ui.d.ts
new file mode 100644
index 0000000..84a3be0
--- /dev/null
+++ b/node_modules/shaka-player/ui.d.ts
@@ -0,0 +1,3 @@
+import shaka from 'shaka-player/dist/shaka-player.ui'
+export * from 'shaka-player/dist/shaka-player.ui'
+export default shaka;
\ No newline at end of file
Thank You, @mevljas
Hi @Security2431 , I've followed to instructions on how to patch shaka-player for the TS export bug, I no longer get the error at import that says it's not not a module, however when I run the app I get this :
What I'm I doing wrong ? did I miss something ?