-
Notifications
You must be signed in to change notification settings - Fork 39
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
strict mode code may not include a with statement #21
Comments
Please wait for the next version for Angular 8 support. its still WIP |
Seems like this might be an issue with html-docx-js which has 40 open issues and hasn't been updated in 3 years. Looks like no longer maintained. Personally, don't care about exporting to docx just pdf and csv in Angular 8. |
I also dont want docx |
@cbryant-zspace thanks for the info, i will check this too |
update for angular 7 and 8 is needed. How can I hide the table so that only the buttons are visible?? |
use [hidden] property on your table |
I have the same problem, when are you going to deliver the next version for support Angular 8? |
@davidct92 Will try today Inshallah |
Kindly check version 1.3.0, it should be fixed |
now exportAsService.save() method is not working! |
Demo updated, the .save method now return an observable, please check readme.md |
Yep got it just now.. |
Still same issue.. |
Which format is this and can you please create a repo for me so i can reproduce the issue?, i do not see it on my project |
When i use your library in production i see blank screen with console error. But not in local |
yes please create a minimal project on github so i can debug it, i do not use the normal angular 8 production build in my project and can not upgrade it now. |
This comment has been minimized.
This comment has been minimized.
@lostmagicK as i said, i do not see this issue on the demo project
|
Any news about this guys please? |
Still facing that problem.. |
Can you please generate a new demo project and try, if the problem happens again then please send me your system configurations and all the used tools with its version like npm, angular, angular cli and the OS too |
@wnabil : |
I also clone your demo into my local and try to run it, but i failed when I execute the
|
Sorry for late response.. Error is occuring in angular v8.1, it was working fine in angular v7+. I have hosted in iis, npm 6.9.0, OS Windows 10 Home, Angular CLI 8.1.1 Node 10.16.0. Note: its working fine in ng serve but when i do ng build and host it in server it is throwing error.. I will share project shortly.. |
Hi, I also get this error, but I only when I use the new Angular 8 differential loading feature.
In my tsconfig.json, when I set the target version to "es5" and compile the application, I get no error. However, when I set the target version to "es2015" to use diffrential loading and compile the application, I get the same error in Chrome's console:
To verify that the bug really came from your library, I removed it and everything worked just fine. You might be using old packages that es2015 doesn't support? |
Thanks for the info, i will look into all the imported libraries and check for possible solutions. |
Is there any workarround for this issue that support es2015 config? or is there any update on the fix for this? |
currently no, i switched back to es5 for the moment but still need more time to implement the project using another lib, i can confirm the problem comes from html-docx-js |
@wnabil This is a great little package. Had my angular app generating PDF's in a few minutes. Thanks for creating. I'm seeing the same error message as others when building for production:
It looks like it's restricted to Angular 8 and production mode. Have you been able to reproduce? If not, what can I do to help.. this is a fantastic little package and definitely worth resolving. |
Heads up: I just removed all imports from DOCX in your package and my app builds in production fine now. So it's definitely the DOCX package that's the offending article. |
Thanks for the confirmation, yes i am trying to implement the docx using another library, any PR is welcome and can save a lot of time. Sorry for the delay guys but i am really busy currently |
@benjibeaumont and @wnabil Please can you assist with the location of the DOCX package. i cant seem to locate it. @wnabil I see that your package fetches the data from the css id. However, is it possible to pass a json data to your package instead so it fetches all the data being passed in the case where pagnation is used to filter the data on the html. |
@iamade https://github.com/wnabil/ngx-export-as/blob/master/projects/ngx-export-as/src/lib/export-as.service.ts import * as htmlDocx from 'html-docx-js/dist/html-docx';
private getDOCX(config: ExportAsConfig): Observable<string | null> {
return Observable.create((observer) => {
const contentDocument: string = document.getElementById(config.elementId).outerHTML;
const content = '<!DOCTYPE html>' + contentDocument;
const converted = htmlDocx.asBlob(content, config.options);
if (config.download) {
this.downloadFromBlob(converted, config.fileName);
observer.next();
observer.complete();
} else {
const reader = new FileReader();
reader.onloadend = () => {
const base64data = reader.result;
observer.next(base64data);
observer.complete();
};
reader.readAsDataURL(converted);
}
});
} |
Still getting the 'SyntaxError: strict mode code may not contain 'with' statements'. Hope it gets fix soon. |
Hi everyone, As a temp solution i am going to publish a new version without docx support. it will be a special version without html-docx-js library until i find a real fix for this issue or switch the implementation to another library |
Angular 8 I have this "strict mode code may not include a with statement" Error when i use this library in production. So i had to remove it completely.
The text was updated successfully, but these errors were encountered: