-
Notifications
You must be signed in to change notification settings - Fork 636
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
Integration with Angular 8 #654
Comments
Hi @cwilkens Thanks for reporting this. Angular is browser-based so Please download |
Looking at my For reference, I have to import it like so: which gives a red squiggly in VS Code about So I'm considering this fixed, thank you! |
FWIW I was having trouble with fs in React using 3.1.0, but having installed from current master branch instead of NPM, that's no longer an issue. |
@readeral - thanks for the feedback |
I'm using 3.1.1 and still experiencing in an Angular 8 client-side app:
I've tried adding node to the Instead I removed |
The problem still exists in angular9
|
I'm fairly new to Angular so maybe I'm setting this up wrong, but I can't get pptxgenjs version 3.1.0 to work with Angular 8.3.0.
I made a plain Angular app using
ng new app
and then callednpm install pptxgenjs
to add it. When I runng serve
to build, I get a few errors like this:ERROR in node_modules/pptxgenjs/types/index.d.ts:85:50 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
So then I add
node
to the types field intsconfig.app.json
. Any way I try to build from there, or change the import/require of pptxgenjs in my angular component, I always get this build error:ERROR in ./node_modules/pptxgenjs/dist/pptxgen.es.js Module not found: Error: Can't resolve 'fs' in 'C:\projects\slides-generator\node_modules\pptxgenjs\dist'
I looked at some other issues that have been closed, and maybe this is due to pptxgenjs thinking it's running on node instead of angular, but I don't know where that code is. (And I tried to put breakpoints in pptxgen.es.js everywhere I saw
fs
but they never got hit. Probably since the VS Code debugger was looking at runtime code instead of the compile process).Any thoughts on how I can work around this or fix this?
The text was updated successfully, but these errors were encountered: