26 Nov 2022

Cricketthomas

Vite build fails on PowerBIReportEmbed import

Describe the bug

When running vite build on an app that uses the recommended import:

import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

The following error is returned:

'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9

This can easily be reproduced in the demo app by changing line 38 of App.vue from:

import PowerBIReportEmbed from '../src/components/PowerBIReportEmbed'; to import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

I've also raised this with Vite: https://github.com/vitejs/vite/issues/11021.

Reproduction

https://stackblitz.com/edit/vitejs-vite-5jwnis?file=main.ts

Logs

vite build
vite v2.9.15 building for production...
transforming (18) node_modules\@vue\reactivity\dist\reactivity.esm-bundler.jsError when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 19 modules transformed.
'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9
1: import { models, Report } from "powerbi-client";
2: import "powerbi-report-authoring";
3: import { PowerBIReportEmbed } from "powerbi-client-vue-js";
            ^
4: import { reportUrl } from "./public/constant";
5: const phasedEmbeddingFlag = false;
error during build:
Error: 'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
    at error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:198:30)
    at Module.error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12543:16)
    at Module.traceVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12902:29)
    at ModuleScope.findVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:11554:39)
    at Identifier.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:7553:40)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at VariableDeclarator.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

Forked On 26 Nov 2022 at 02:45:04

Cricketthomas

@jwarner00 @cricketthomas Did you get a bunch of TypeScript compiler errors from powerbi-client-vue-js when running yarn build? I've listed a few in my previous comment.

I didn't get any of those. Not entirely sure, but it looks like those errors are specific to your code?

Commented On 26 Nov 2022 at 02:45:04

Weskubo-cgi

Vite build fails on PowerBIReportEmbed import

Describe the bug

When running vite build on an app that uses the recommended import:

import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

The following error is returned:

'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9

This can easily be reproduced in the demo app by changing line 38 of App.vue from:

import PowerBIReportEmbed from '../src/components/PowerBIReportEmbed'; to import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

I've also raised this with Vite: https://github.com/vitejs/vite/issues/11021.

Reproduction

https://stackblitz.com/edit/vitejs-vite-5jwnis?file=main.ts

Logs

vite build
vite v2.9.15 building for production...
transforming (18) node_modules\@vue\reactivity\dist\reactivity.esm-bundler.jsError when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 19 modules transformed.
'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9
1: import { models, Report } from "powerbi-client";
2: import "powerbi-report-authoring";
3: import { PowerBIReportEmbed } from "powerbi-client-vue-js";
            ^
4: import { reportUrl } from "./public/constant";
5: const phasedEmbeddingFlag = false;
error during build:
Error: 'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
    at error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:198:30)
    at Module.error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12543:16)
    at Module.traceVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12902:29)
    at ModuleScope.findVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:11554:39)
    at Identifier.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:7553:40)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at VariableDeclarator.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

Forked On 26 Nov 2022 at 12:39:43

Weskubo-cgi

@may-hartov @bapat-atharva Is it possible to get some assistance? While this component works great, it's currently not production ready.

Commented On 26 Nov 2022 at 12:39:43

Weskubo-cgi

Vite build fails on PowerBIReportEmbed import

Describe the bug

When running vite build on an app that uses the recommended import:

import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

The following error is returned:

'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9

This can easily be reproduced in the demo app by changing line 38 of App.vue from:

import PowerBIReportEmbed from '../src/components/PowerBIReportEmbed'; to import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

I've also raised this with Vite: https://github.com/vitejs/vite/issues/11021.

Reproduction

https://stackblitz.com/edit/vitejs-vite-5jwnis?file=main.ts

Logs

vite build
vite v2.9.15 building for production...
transforming (18) node_modules\@vue\reactivity\dist\reactivity.esm-bundler.jsError when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 19 modules transformed.
'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9
1: import { models, Report } from "powerbi-client";
2: import "powerbi-report-authoring";
3: import { PowerBIReportEmbed } from "powerbi-client-vue-js";
            ^
4: import { reportUrl } from "./public/constant";
5: const phasedEmbeddingFlag = false;
error during build:
Error: 'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
    at error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:198:30)
    at Module.error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12543:16)
    at Module.traceVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12902:29)
    at ModuleScope.findVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:11554:39)
    at Identifier.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:7553:40)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at VariableDeclarator.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

Forked On 22 Nov 2022 at 08:31:44

Weskubo-cgi

Feedback from https://github.com/vitejs/vite/issues/11021:

It's an issue with powerbi-client-vue-js. It shouldn't be exporting raw TS file, plus the TS file doesn't contain any TS specific stuff too, it should export as .js and it'll work.

Commented On 22 Nov 2022 at 08:31:44

Weskubo-cgi

Vite build fails on PowerBIReportEmbed import

Describe the bug

When running vite build on an app that uses the recommended import:

import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

The following error is returned:

'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9

This can easily be reproduced in the demo app by changing line 38 of App.vue from:

import PowerBIReportEmbed from '../src/components/PowerBIReportEmbed'; to import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

Reproduction

https://stackblitz.com/edit/vitejs-vite-5jwnis?file=main.ts

Logs

vite build
vite v2.9.15 building for production...
transforming (18) node_modules\@vue\reactivity\dist\reactivity.esm-bundler.jsError when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 19 modules transformed.
'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9
1: import { models, Report } from "powerbi-client";
2: import "powerbi-report-authoring";
3: import { PowerBIReportEmbed } from "powerbi-client-vue-js";
            ^
4: import { reportUrl } from "./public/constant";
5: const phasedEmbeddingFlag = false;
error during build:
Error: 'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
    at error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:198:30)
    at Module.error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12543:16)
    at Module.traceVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12902:29)
    at ModuleScope.findVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:11554:39)
    at Identifier.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:7553:40)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at VariableDeclarator.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

Forked On 21 Nov 2022 at 06:51:55

Weskubo-cgi

@jwarner00 @cricketthomas Did you get a bunch of TypeScript compiler errors from powerbi-client-vue-js when running yarn build? I've listed a few in my previous comment.

Commented On 21 Nov 2022 at 06:51:55

Borexinghai

started

Started On 12 Nov 2022 at 04:23:22

Klysman08

started

Started On 11 Nov 2022 at 07:00:56

Weskubo-cgi

Vite build fails on PowerBIReportEmbed import

Describe the bug

When running vite build on an app that uses the recommended import:

import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

The following error is returned:

'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9

This can easily be reproduced in the demo app by changing line 38 of App.vue from:

import PowerBIReportEmbed from '../src/components/PowerBIReportEmbed'; to import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

Reproduction

https://stackblitz.com/edit/vitejs-vite-5jwnis?file=main.ts

Logs

vite build
vite v2.9.15 building for production...
transforming (18) node_modules\@vue\reactivity\dist\reactivity.esm-bundler.jsError when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 19 modules transformed.
'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9
1: import { models, Report } from "powerbi-client";
2: import "powerbi-report-authoring";
3: import { PowerBIReportEmbed } from "powerbi-client-vue-js";
            ^
4: import { reportUrl } from "./public/constant";
5: const phasedEmbeddingFlag = false;
error during build:
Error: 'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
    at error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:198:30)
    at Module.error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12543:16)
    at Module.traceVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12902:29)
    at ModuleScope.findVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:11554:39)
    at Identifier.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:7553:40)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at VariableDeclarator.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

Forked On 10 Nov 2022 at 11:44:59

Weskubo-cgi

@jwarner00 your solution worked! Thank you!

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import commonjs from '@rollup/plugin-commonjs'; // for pbi client vue, since it wasnt working

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), commonjs({ include: '**.umd.ts', extensions: ['.ts'] })],
  server: {
    port: '8080'
  }
}) 

@jwarner00 @cricketthomas this fix works with my sample code: https://stackblitz.com/edit/vitejs-vite-mf3n9s?file=vite.config.ts. It seemed to cause a secondary issue though in my actual code: '__moduleExports' is not exported by node_modules/powerbi-client/dist/powerbi.js, imported by C:/myproject/node_modules/powerbi-client/dist/powerbi.js?commonjs-proxy file: C:/myproject/node_modules/powerbi-client/dist/powerbi.js?commonjs-proxy:1:9 1: export { __moduleExports as default } from "C:/myproject/node_modules/powerbi-client/dist/powerbi.js"; I need to do some additional debugging to figure out why there's a discrepancy (which may be due in part to version differences).

Commented On 10 Nov 2022 at 11:44:59

Weskubo-cgi

Vite build fails on PowerBIReportEmbed import

Describe the bug

When running vite build on an app that uses the recommended import:

import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

The following error is returned:

'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9

This can easily be reproduced in the demo app by changing line 38 of App.vue from:

import PowerBIReportEmbed from '../src/components/PowerBIReportEmbed'; to import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

Reproduction

https://stackblitz.com/edit/vitejs-vite-5jwnis?file=main.ts

Logs

vite build
vite v2.9.15 building for production...
transforming (18) node_modules\@vue\reactivity\dist\reactivity.esm-bundler.jsError when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 19 modules transformed.
'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9
1: import { models, Report } from "powerbi-client";
2: import "powerbi-report-authoring";
3: import { PowerBIReportEmbed } from "powerbi-client-vue-js";
            ^
4: import { reportUrl } from "./public/constant";
5: const phasedEmbeddingFlag = false;
error during build:
Error: 'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
    at error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:198:30)
    at Module.error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12543:16)
    at Module.traceVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12902:29)
    at ModuleScope.findVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:11554:39)
    at Identifier.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:7553:40)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at VariableDeclarator.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

Forked On 10 Nov 2022 at 11:28:19

Weskubo-cgi

I am unsure if this is a bug with PowerBi-Client-Vue-JS or a configuration issue with vite.

I had the same issue with a vite build, and got it building by using rollup/plugin-commonjs and supplying the following configuration: { include: '**.umd.ts', extensions: ['.ts'] }

Vite docs on pre-bundling: https://vitejs.dev/guide/dep-pre-bundling.html Rollup/plugin-commonjs docs: https://www.npmjs.com/package/@rollup/plugin-commonjs

It's hard to say. IMO if it works in development mode but the production build fails then there must be an issue with Vite (underlying code or configuration). I will raise an Issue there as well.

Commented On 10 Nov 2022 at 11:28:19

Cricketthomas

Vite build fails on PowerBIReportEmbed import

Describe the bug

When running vite build on an app that uses the recommended import:

import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

The following error is returned:

'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9

This can easily be reproduced in the demo app by changing line 38 of App.vue from:

import PowerBIReportEmbed from '../src/components/PowerBIReportEmbed'; to import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

Reproduction

https://stackblitz.com/edit/vitejs-vite-5jwnis?file=public/vite.svg

Logs

vite build
vite v2.9.15 building for production...
transforming (18) node_modules\@vue\reactivity\dist\reactivity.esm-bundler.jsError when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 19 modules transformed.
'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9
1: import { models, Report } from "powerbi-client";
2: import "powerbi-report-authoring";
3: import { PowerBIReportEmbed } from "powerbi-client-vue-js";
            ^
4: import { reportUrl } from "./public/constant";
5: const phasedEmbeddingFlag = false;
error during build:
Error: 'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
    at error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:198:30)
    at Module.error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12543:16)
    at Module.traceVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12902:29)
    at ModuleScope.findVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:11554:39)
    at Identifier.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:7553:40)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at VariableDeclarator.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

Forked On 26 Oct 2022 at 08:56:44

Cricketthomas

@jwarner00 your solution worked! Thank you!

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import commonjs from '@rollup/plugin-commonjs'; // for pbi client vue, since it wasnt working

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), commonjs({ include: '**.umd.ts', extensions: ['.ts'] })],
  server: {
    port: '8080'
  }
}) 

Commented On 26 Oct 2022 at 08:56:44

Cricketthomas

Vite build fails on PowerBIReportEmbed import

Describe the bug

When running vite build on an app that uses the recommended import:

import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

The following error is returned:

'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9

This can easily be reproduced in the demo app by changing line 38 of App.vue from:

import PowerBIReportEmbed from '../src/components/PowerBIReportEmbed'; to import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

Reproduction

https://stackblitz.com/edit/vitejs-vite-5jwnis?file=public/vite.svg

Logs

vite build
vite v2.9.15 building for production...
transforming (18) node_modules\@vue\reactivity\dist\reactivity.esm-bundler.jsError when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 19 modules transformed.
'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9
1: import { models, Report } from "powerbi-client";
2: import "powerbi-report-authoring";
3: import { PowerBIReportEmbed } from "powerbi-client-vue-js";
            ^
4: import { reportUrl } from "./public/constant";
5: const phasedEmbeddingFlag = false;
error during build:
Error: 'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
    at error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:198:30)
    at Module.error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12543:16)
    at Module.traceVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12902:29)
    at ModuleScope.findVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:11554:39)
    at Identifier.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:7553:40)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at VariableDeclarator.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

Forked On 26 Oct 2022 at 08:45:36

Cricketthomas

pretty amazing they shipped it like this

Commented On 26 Oct 2022 at 08:45:36

Jwarner00

Vite build fails on PowerBIReportEmbed import

Describe the bug

When running vite build on an app that uses the recommended import:

import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

The following error is returned:

'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9

This can easily be reproduced in the demo app by changing line 38 of App.vue from:

import PowerBIReportEmbed from '../src/components/PowerBIReportEmbed'; to import { PowerBIReportEmbed } from 'powerbi-client-vue-js';

I can put together a sample project if required but just wanted to get this created while it's fresh in mind.

Reproduction

https://stackblitz.com/edit/vitejs-vite-5jwnis?file=public/vite.svg

Logs

vite build
vite v2.9.15 building for production...
transforming (18) node_modules\@vue\reactivity\dist\reactivity.esm-bundler.jsError when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 19 modules transformed.
'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
file: C:/powerbi-client-vue-js/vue/demo/App.vue:3:9
1: import { models, Report } from "powerbi-client";
2: import "powerbi-report-authoring";
3: import { PowerBIReportEmbed } from "powerbi-client-vue-js";
            ^
4: import { reportUrl } from "./public/constant";
5: const phasedEmbeddingFlag = false;
error during build:
Error: 'PowerBIReportEmbed' is not exported by node_modules/powerbi-client-vue-js/dist/powerbi-client-vue-js.umd.ts, imported by App.vue
    at error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:198:30)
    at Module.error (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12543:16)
    at Module.traceVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:12902:29)
    at ModuleScope.findVariable (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:11554:39)
    at Identifier.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:7553:40)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at Property.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
    at ObjectExpression.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5379:73)
    at VariableDeclarator.bind (C:\powerbi-client-vue-js\vue\demo\node_modules\rollup\dist\shared\rollup.js:5383:23)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

Forked On 25 Oct 2022 at 04:49:51

Jwarner00

I am unsure if this is a bug with PowerBi-Client-Vue-JS or a configuration issue with vite.

I had the same issue with a vite build, and got it building by using rollup/plugin-commonjs and supplying the following configuration: { include: '**.umd.ts', extensions: ['.ts'] }

Vite docs on pre-bundling: https://vitejs.dev/guide/dep-pre-bundling.html Rollup/plugin-commonjs docs: https://www.npmjs.com/package/@rollup/plugin-commonjs

Commented On 25 Oct 2022 at 04:49:51
Issue Comment

Anhln

Does it support vue2?
Forked On 24 Oct 2022 at 06:55:55

Anhln

only support vue=>3

Commented On 24 Oct 2022 at 06:55:55

Clock321

started

Started On 21 Oct 2022 at 06:00:40

Tracyvon

started

Started On 14 Oct 2022 at 01:19:31

CavalierSpirit

started

Started On 14 Oct 2022 at 12:48:31

KotanaSai21

started

Started On 11 Oct 2022 at 10:52:56

Ksyang21

started

Started On 06 Oct 2022 at 02:27:15

Nazmi-tarmizi-knb

started

Started On 29 Sep 2022 at 01:32:43

Carrey-k

started

Started On 26 Sep 2022 at 02:23:50

Saul-Shen

started

Started On 23 Sep 2022 at 10:56:05

Lzq920

started

Started On 22 Sep 2022 at 08:50:37

CookyG

started

Started On 22 Sep 2022 at 12:58:34

Nutsdo

started

Started On 20 Sep 2022 at 09:52:40

Qixingchong

started

Started On 19 Sep 2022 at 05:31:15

CnLGMing

started

Started On 18 Sep 2022 at 07:56:12

Tx7do

started

Started On 15 Sep 2022 at 08:52:14

SikoraTomasz

started

Started On 14 Sep 2022 at 09:06:50

About Repository

Power BI Vue.js component. This library lets you embed Power BI report, dashboard, dashboard tile, report visual, or Q&A in your Vue.js application.
Language: TypeScript
Star: 130
Fork: 8
Watchers: 130
Open Issues: 1
https://github.com/microsoft/powerbi-client-vue-js
Other
Last updated: 12 Nov 2022