Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular integration failed - '/node_modules/PptxGenJS/dist/pptxgen"' resolves to a non-module entity and cannot be imported using this construct.' #444

Closed
Prasanth-ECE opened this issue Dec 3, 2018 · 4 comments

Comments

@Prasanth-ECE
Copy link

Prasanth-ECE commented Dec 3, 2018

Tried the Ppt generation into the angular 5 project by installing through yarn.
Getting error as '/node_modules/PptxGenJS/dist/pptxgen"' resolves to a non-module entity and cannot be imported using this construct.'

seems the error is around the exporting module.

exported PptxGenJS module be like
class PptxGenJS { }
'export = PptxGenJS.PptxGenJS;' - pptxgen.d.ts

if i change that to
export default class PptxGenJS { }
'export = PptxGenJS;'

source from 'https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this'

then it's working fine.

@Prasanth-ECE Prasanth-ECE changed the title Angular integration failed '/node_modules/PptxGenJS/dist/pptxgen"' resolves to a non-module entity and cannot be imported using this construct.' Angular integration failed - '/node_modules/PptxGenJS/dist/pptxgen"' resolves to a non-module entity and cannot be imported using this construct.' Dec 3, 2018
@gitbrent
Copy link
Owner

gitbrent commented Dec 5, 2018

Hi @Prasanth-ECE

The typescript defs file has been refactored and may fix this issue if you've not already found a solution yourself.

See Pull #443

@crazyx13th
Copy link

sorry, but both not working for me.
the new version gives me a:
Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
I tried a lot of combinations, but always fail

thanks!

@gitbrent
Copy link
Owner

Dang.

Does it build if you remove the first 2 lines?

export as namespace PptxGenJS;

export = PptxGenJS;

@crazyx13th
Copy link

I try all combinations, but don't find a clean solution. Maybe I'll found some time next weeks to update the d.ts file, but now...

And there are some missing props, too
grafik

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants