Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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>
Solved! Go to Solution.
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
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
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
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
2 | |
2 | |
1 | |
1 |