liprec / powerbi-d3jsvisual

Home of the code of my Power BI Custom Visual: D3JS Visual
MIT License
57 stars 20 forks source link

pbiviz start fails after build #5

Open rjanik opened 6 years ago

rjanik commented 6 years ago

After building with your instructions pbiviz start fails. Sorry if this something straightforward first time building a pbi visual.

`>pbiviz start

info Building visual...

error TYPESCRIPT /src/visual.ts : (66,44) Cannot find namespace 'UglifyJS'.

error TYPESCRIPT /src/visual.ts : (617,31) Property 'launchUrl' does not exist on type 'IVisualHost'.

error TYPESCRIPT /src/visual.ts : (658,26) Cannot find name 'UglifyJS'.`

liprec commented 6 years ago

Did you run the command: node .\\node_modules\\uglify-js\\bin\\uglifyjs --self -o .\\node_modules\\uglify-js\\lib\\uglify-js.js to create the correct UglifyJS file

And regarding the 'launchUrl' error, what version of pbiviz do you use?

rjanik commented 6 years ago

Sorry for the long delay getting back. I did run the node command and it appeared to create the file. pbiviz version is 1.11.3.

karthikasok commented 6 years ago

I have the same issue. Was this resolved? I have pbiviz version 1.12.0

Hugoberry commented 6 years ago

not a Typescript expert however the following fix helped me solve the errors

error TYPESCRIPT /src/visual.ts : (68,44) Cannot find namespace 'UglifyJS'. error TYPESCRIPT /src/visual.ts : (660,26) Cannot find name 'UglifyJS'.

In \node_modules\@types\uglify-js\index.d.ts add the following line

export as namespace UglifyJS;

alexiscanizares commented 6 years ago

Hi, have you resolve the issue with launchUrl?

Thanks. Alexis

adriennn commented 6 years ago

I managed to get the build working with the following steps:

  1. in visual.ts, comment out line 617 (//this.host.launchUrl(this.settings.general.helpUrl)) 🙄
  2. in pbiviz.json, change: "node_modules/dist/d3.min.js" for "node_modules/d3/dist/d3.min.js"
  3. install yarn and rollup
  4. go to node_modules/d3
  5. run d3 build (npm run prepublishOnly) 6 go back to visualizaiton root folder
  6. pbiviz package

disclaimer: tested with a build that uses D3 V 5.7.0