Azure-Samples / powerbi-angular-client

PowerBI sample demonstrating use of angular-powerbi
http://azure-samples.github.io/powerbi-angular-client
MIT License
21 stars 18 forks source link

Cannot get example running #2

Closed chazkii closed 8 years ago

chazkii commented 8 years ago

I have tried to follow the instructions but I cannot get gulp compile to succeed, which means when I serve the app, I get a whole bunch of errors in the browser console.

After npm and jspm install, when compiling, I get the following error:

$ gulp compile
[21:11:16] Working directory changed to ~/work/moa/powerbi-angular-client
(node:68220) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[21:11:16] Using gulpfile ~/work/moa/powerbi-angular-client/gulpfile.js
[21:11:16] Starting 'compile'...
[21:11:16] Starting 'compile:app'...
app/app.ts(1,8): error TS1192: Module ''angular'' has no default export.
app/app.ts(2,8): error TS1192: Module ''angular-ui-router'' has no default export.
app/app.ts(3,28): error TS2307: Cannot find module 'angular-powerbi'.
app/app.ts(10,29): error TS2307: Cannot find module './services/reports.js'.
app/app.ts(11,23): error TS2307: Cannot find module './services/utilities.js'.
app/app.ts(14,80): error TS2307: Cannot find module './application/module.js'.
app/app.ts(15,76): error TS2307: Cannot find module './scenario1/module.js'.
app/app.ts(16,76): error TS2307: Cannot find module './scenario2/module.js'.
app/application/module.ts(1,24): error TS2307: Cannot find module './controller.js'.
app/application/module.ts(2,19): error TS2307: Cannot find module './route.js'.
app/scenario1/controller.ts(2,12): error TS2503: Cannot find namespace 'PowerBi'.
app/scenario1/module.ts(1,24): error TS2307: Cannot find module './controller.js'.
app/scenario1/module.ts(2,19): error TS2307: Cannot find module './route.js'.
app/scenario1/route.ts(1,32): error TS2307: Cannot find module '../services/reports.js'.
app/scenario1/route.ts(3,69): error TS2503: Cannot find namespace 'PowerBi'.
app/scenario2/controller.ts(1,32): error TS2307: Cannot find module '../services/reports.js'.
app/scenario2/controller.ts(2,23): error TS2307: Cannot find module '../services/utilities.js'.
app/scenario2/controller.ts(3,22): error TS2307: Cannot find module 'angular-powerbi'.
app/scenario2/module.ts(1,24): error TS2307: Cannot find module './controller.js'.
app/scenario2/module.ts(2,19): error TS2307: Cannot find module './route.js'.
[21:11:18] TypeScript: 20 semantic errors
[21:11:18] TypeScript: emit succeeded (with errors)
[21:11:18] Finished 'compile:app' after 1.35 s
[21:11:18] Starting 'copy:modules'...
[21:11:18] Finished 'copy:modules' after 22 ms
[21:11:18] Finished 'compile' after 1.37 s

On my own branch, I made some changes so that I could use:

and managed to get further, but still running into issues:

$ gulp compile
(node:65268) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[21:02:37] Using gulpfile ~/work/moa/powerbi-angular-client/gulpfile.js
[21:02:37] Starting 'compile'...
[21:02:37] Starting 'compile:app'...
app/app.ts(3,28): error TS2307: Cannot find module 'angular-powerbi'.
app/scenario1/controller.ts(2,12): error TS2503: Cannot find namespace 'PowerBi'.
app/scenario1/route.ts(3,69): error TS2503: Cannot find namespace 'PowerBi'.
app/scenario2/controller.ts(3,22): error TS2307: Cannot find module 'angular-powerbi'.
[21:02:39] TypeScript: 4 semantic errors
[21:02:39] TypeScript: emit succeeded (with errors)
[21:02:39] Finished 'compile:app' after 1.39 s
[21:02:39] Starting 'copy:modules'...
[21:02:39] Finished 'copy:modules' after 22 ms
[21:02:39] Finished 'compile' after 1.41 s

Can you please help by updating the docs? I'm new to Typescript and have a few hours on this already :(

mattmazzola commented 8 years ago

I updated the repo to use newer version of typings.

I also updated the README to add note about known errors during compilation step.

There is supposed to be a way to configure JSPM to use tsc to compile typescript files as it loads them but I think it broke from 0.16 to 0.17 and the work around was to compile them to .js first and then use normal JSPM configuration.

It didn't seem worth it to put much effort into JSPM configuration since it's not stable, but if you know how feel free to send pull request.