Reply
Highlighted
Regular Visitor
Posts: 19
Registered: ‎10-10-2018
Accepted Solution

I can "start" my visual successfully but get an error on "package"

As you can see below, "pbiviz start" gives no errors (and the developer control behaves as expected) but "pbiviz package" croaks on a JS file generated from my TS.

 

Worse, the line/column reported for the error are incorrect- line 586 of the generated file is

 

        }

 

and does not have 50 characters. No nearby line appears to have an = sign anywhere near column 50 either.

 

PS C:\Users\russell\Source\Workspaces\FloridaHealthFinder\PBI\fHFFilter> pbiviz package
info Building visual...
error UNKNOWN JS_Parse_Error {
message: 'Unexpected token operator «=», expected punc «,»',
filename:
'C:\\Users\\russell\\Source\\Workspaces\\FloridaHealthFinder\\PBI\\fHFFilter\\.tmp\\drop\\visual.js',
line: 586,
col: 50,
pos: 28609,
stack:
'Error\n at new JS_Parse_Error (eval at <anonymous> (C:\\Users\\russell\\AppData\\Roaming\\npm\\node_modules\\powe
rbi-visuals-tools\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:1526:18)\n at js_error (eval at <anonym
ous> (C:\\Users\\russell\\AppData\\Roaming\\npm\\node_modules\\powerbi-visuals-tools\\node_modules\\uglify-js\\tools\\no
de.js:22:1), <anonymous>:1534:11)\n at croak (eval at <anonymous> (C:\\Users\\russell\\AppData\\Roaming\\npm\\node_mo
dules\\powerbi-visuals-tools\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2026:9)\n at token_error (ev
al at <anonymous> (C:\\Users\\russell\\AppData\\Roaming\\npm\\node_modules\\powerbi-visuals-tools\\node_modules\\uglify-
js\\tools\\node.js:22:1), <anonymous>:2034:9)\n at expect_token (eval at <anonymous> (C:\\Users\\russell\\AppData\\Ro
aming\\npm\\node_modules\\powerbi-visuals-tools\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2047:9)\n
at expect (eval at <anonymous> (C:\\Users\\russell\\AppData\\Roaming\\npm\\node_modules\\powerbi-visuals-tools\\node_mo
dules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2050:36)\n at eval (eval at <anonymous> (C:\\Users\\russell\\AppD
ata\\Roaming\\npm\\node_modules\\powerbi-visuals-tools\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2315:
52)\n at function_ (eval at <anonymous> (C:\\Users\\russell\\AppData\\Roaming\\npm\\node_modules\\powerbi-visuals-too
ls\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2320:15)\n at eval (eval at <anonymous> (C:\\Users\\ru
ssell\\AppData\\Roaming\\npm\\node_modules\\powerbi-visuals-tools\\node_modules\\uglify-js\\tools\\node.js:22:1), <anony
mous>:2161:24)\n at eval (eval at <anonymous> (C:\\Users\\russell\\AppData\\Roaming\\npm\\node_modules\\powerbi-visua
ls-tools\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2073:24)' }
PS C:\Users\russell\Source\Workspaces\FloridaHealthFinder\PBI\fHFFilter> pbiviz start
info Building visual...
done build complete

info Starting server...
info Server listening on port 8080.

info Stopping server...
^CTerminate batch job (Y/N)? y
PS C:\Users\russell\Source\Workspaces\FloridaHealthFinder\PBI\fHFFilter>


Accepted Solutions
Regular Visitor
Posts: 19
Registered: ‎10-10-2018

Re: I can "start" my visual successfully but get an error on "package"

Figured this out, but may be of use to someone else.

 

I'd made a small change to an included JS file for an external component to have a way to disable a problematic behavior.

 

  function updateDisplay(control, omitChangeEvent = false) {

 

I edited to

 

  function updateDisplay(control, omitChangeEvent) {

 

which is functionally eqivalent since most calls omit the second arg and undefined and false both pass the

 

if (!omitChangeEvent) {
 
test

View solution in original post

Moderator
Posts: 1,564
Registered: ‎12-02-2016

Re: I can "start" my visual successfully but get an error on "package"

PBIVIZ tools do not support ES2015+ syntax that means you should make sure all of JS files are in ES5 or ES3.

Otherwise, JS code minification will fail.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post


All Replies
Regular Visitor
Posts: 19
Registered: ‎10-10-2018

Re: I can "start" my visual successfully but get an error on "package"

Figured this out, but may be of use to someone else.

 

I'd made a small change to an included JS file for an external component to have a way to disable a problematic behavior.

 

  function updateDisplay(control, omitChangeEvent = false) {

 

I edited to

 

  function updateDisplay(control, omitChangeEvent) {

 

which is functionally eqivalent since most calls omit the second arg and undefined and false both pass the

 

if (!omitChangeEvent) {
 
test
Moderator
Posts: 1,564
Registered: ‎12-02-2016

Re: I can "start" my visual successfully but get an error on "package"

PBIVIZ tools do not support ES2015+ syntax that means you should make sure all of JS files are in ES5 or ES3.

Otherwise, JS code minification will fail.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com