Forum Discussion
Cannot import multiple r-script sources in RHTML visual
- 6 years ago
Hello,
It is an issue in the template, we will fix it soon.
To fix it for you now, please, change NodeListOf by HTMLCollectionOf type. It should help.
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected] - Anonymous6 years ago
Confirmed. Changing the following seems to fix the issue:
./src/visual.ts
148 let headList: NodeListOf = el.getElementsByTagName("head"); > let headList: HTMLCollectionOf = el.getElementsByTagName("head"); 160 let bodyList: NodeListOf = el.getElementsByTagName("body"); > let bodyList: HTMLCollectionOf = el.getElementsByTagName("body");
Confirmed. Changing the following seems to fix the issue:
./src/visual.ts
| 148 | let headList: NodeListOf = el.getElementsByTagName("head"); | > | let headList: HTMLCollectionOf = el.getElementsByTagName("head"); |
| 160 | let bodyList: NodeListOf = el.getElementsByTagName("body"); | > | let bodyList: HTMLCollectionOf = el.getElementsByTagName("body"); |
When I try to do as robjensen does here
Anonymous wrote:Confirmed. Changing the following seems to fix the issue:
./src/visual.ts
148 let headList: NodeListOf = el.getElementsByTagName("head"); > let headList: HTMLCollectionOf = el.getElementsByTagName("head"); 160 let bodyList: NodeListOf = el.getElementsByTagName("body"); > let bodyList: HTMLCollectionOf = el.getElementsByTagName("body");
I get the following error:
C:\sampleRHTMLVisual>pbiviz package
info Building visual...
info Start preparing plugin template
info Finish preparing plugin template
Error parsing bundle asset "C:\sampleRHTMLVisual\.tmp\drop\visual.js": no such file
No bundles were parsed. Analyzer will show only original module sizes from stats file.
Webpack Bundle Analyzer saved report to C:\sampleRHTMLVisual\webpack.statistics.prod.html
ERROR Failed to compile with 2 errors 12:11:45 PM
error in C:\sampleRHTMLVisual\src\visual.ts
[tsl] ERROR in C:\sampleRHTMLVisual\src\visual.ts(148,27)
TS2314: Generic type 'HTMLCollectionOf<T>' requires 1 type argument(s).
error in C:\sampleRHTMLVisual\src\visual.ts
[tsl] ERROR in C:\sampleRHTMLVisual\src\visual.ts(160,23)
TS2314: Generic type 'HTMLCollectionOf<T>' requires 1 type argument(s).
Any suggestions?
- Anonymous6 years agoNot applicable
Anonymous wrote:When I try to do as robjensen does here
Anonymous wrote:Confirmed. Changing the following seems to fix the issue:
./src/visual.ts
148 let headList: NodeListOf = el.getElementsByTagName("head"); > let headList: HTMLCollectionOf = el.getElementsByTagName("head"); 160 let bodyList: NodeListOf = el.getElementsByTagName("body"); > let bodyList: HTMLCollectionOf = el.getElementsByTagName("body"); I get the following error:
C:\sampleRHTMLVisual>pbiviz package
info Building visual...
info Start preparing plugin template
info Finish preparing plugin template
Error parsing bundle asset "C:\sampleRHTMLVisual\.tmp\drop\visual.js": no such fileNo bundles were parsed. Analyzer will show only original module sizes from stats file.
Webpack Bundle Analyzer saved report to C:\sampleRHTMLVisual\webpack.statistics.prod.html
ERROR Failed to compile with 2 errors 12:11:45 PMerror in C:\sampleRHTMLVisual\src\visual.ts
[tsl] ERROR in C:\sampleRHTMLVisual\src\visual.ts(148,27)
TS2314: Generic type 'HTMLCollectionOf<T>' requires 1 type argument(s).error in C:\sampleRHTMLVisual\src\visual.ts
[tsl] ERROR in C:\sampleRHTMLVisual\src\visual.ts(160,23)
TS2314: Generic type 'HTMLCollectionOf<T>' requires 1 type argument(s).Any suggestions?
What is your complete line of code in row 148? The table in this webpage wrapped each line of text into two rows, but they should just be one row each in visual.ts
Row 148 should read:
let headList: HTMLCollectionOf<HTMLHeadElement> = el.getElementsByTagName("head");Row 160 should read:
let bodyList: HTMLCollectionOf<HTMLBodyElement> = el.getElementsByTagName("body");