Giter Site home page Giter Site logo

Comments (36)

lostmagicK avatar lostmagicK commented on September 24, 2024 2

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

from ngx-export-as.

William-Paradis avatar William-Paradis commented on September 24, 2024 2

Hi,

I also get this error, but I only when I use the new Angular 8 differential loading feature.

Differential loading is a strategy where the CLI builds two separate bundles as part of your deployed application.
The first bundle contains modern ES2015 syntax, takes advantage of built-in support in modern browsers, ships less polyfills, and results in a smaller bundle size.
The second bundle contains code in the old ES5 syntax, along with all necessary polyfills. This results in a larger bundle size, but supports older browsers.
This strategy allows you to continue to build your web application to support multiple browsers, but only load the necessary code that the browser needs.

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:

Strict mode code may not include a with statement

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?

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

Please wait for the next version for Angular 8 support. its still WIP

from ngx-export-as.

cbryant-zspace avatar cbryant-zspace commented on September 24, 2024

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.
Perhaps replace with jsdocx or docx.

Personally, don't care about exporting to docx just pdf and csv in Angular 8.

from ngx-export-as.

lostmagicK avatar lostmagicK commented on September 24, 2024

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.
Perhaps replace with jsdocx or docx.

Personally, don't care about exporting to docx just pdf and csv in Angular 8.

I also dont want docx
Where can i change this?

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

@cbryant-zspace thanks for the info, i will check this too

from ngx-export-as.

Hareem123 avatar Hareem123 commented on September 24, 2024

update for angular 7 and 8 is needed. How can I hide the table so that only the buttons are visible??

from ngx-export-as.

davidct92 avatar davidct92 commented on September 24, 2024

I have the same problem, when are you going to deliver the next version for support Angular 8?

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

@davidct92 Will try today Inshallah

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

Kindly check version 1.3.0, it should be fixed
Waiting your confirmation @lostmagicK

from ngx-export-as.

lostmagicK avatar lostmagicK commented on September 24, 2024

Kindly check version 1.3.0, it should be fixed
Waiting your confirmation @lostmagicK

now exportAsService.save() method is not working!
No error though

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

Demo updated, the .save method now return an observable, please check readme.md

from ngx-export-as.

lostmagicK avatar lostmagicK commented on September 24, 2024

Demo updated, the .save method now return an observable, please check readme.md

Yep got it just now..
Its working..
Let me check in production

from ngx-export-as.

lostmagicK avatar lostmagicK commented on September 24, 2024

Demo updated, the .save method now return an observable, please check readme.md

Still same issue..
"strict mode code may not include a with statement"

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

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

from ngx-export-as.

lostmagicK avatar lostmagicK commented on September 24, 2024

When i use your library in production i see blank screen with console error. But not in local

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

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.

from ngx-export-as.

lostmagicK avatar lostmagicK commented on September 24, 2024

image
Error is only in production build

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

@lostmagicK as i said, i do not see this issue on the demo project
Please upload me a project on github i can not reproduce the issue
npm install http-server -g

ng build --prod --aot

http-server dist/ngx-export-as-demo

image

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

Any news about this guys please?

from ngx-export-as.

lostmagicK avatar lostmagicK commented on September 24, 2024

Still facing that problem..
Project is running fine in debug but if i enable production im getting error

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

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

from ngx-export-as.

chenheng0910 avatar chenheng0910 commented on September 24, 2024

@wnabil :
I also had the same error.
I use the IONIC to generate a new demo, it's running well.
And then
npm install --save ngx-export-as
and import { ExportAsModule } from 'ngx-export-as';
and add ExportAsModule to my imports Array.
Then error come in my console:
Uncaught SyntaxError: Strict mode code may not include a with statement;
here is my dependencies:
"@angular/common": "~8.1.2", "@angular/compiler": "~8.1.2", "@angular/core": "~8.1.2", "@angular/forms": "~8.1.2", "@angular/platform-browser": "~8.1.2", "@angular/platform-browser-dynamic": "~8.1.2", "@angular/router": "~8.1.2", "@ionic-native/core": "^5.0.0", "@ionic-native/splash-screen": "^5.0.0", "@ionic-native/status-bar": "^5.0.0", "@ionic/angular": "^4.7.1", "@types/echarts": "^4.1.9", "core-js": "^2.5.4", "echarts": "^4.2.1", "ngx-export-as": "^1.3.0", "rxjs": "~6.5.1", "tslib": "^1.9.0", "zone.js": "~0.9.1"
npm version is 6.7.0, node version is 10.15.0.
Looking forward to your reply.

from ngx-export-as.

chenheng0910 avatar chenheng0910 commented on September 24, 2024

I also clone your demo into my local and try to run it, but i failed when I execute the ng serve command:

ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/array' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/date' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/function' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/map' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/math' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/number' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/object' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/parse-float' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/parse-int' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/reflect' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/regexp' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/set' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/string' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/symbol' in '/Users/chenheng/myWork/ngx-export-as/src' ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'core-js/es/weak-map' in '/Users/chenheng/myWork/ngx-export-as/src' ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** ℹ 「wdm」: Failed to compile.

from ngx-export-as.

lostmagicK avatar lostmagicK commented on September 24, 2024

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

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..

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

Thanks for the info, i will look into all the imported libraries and check for possible solutions.

from ngx-export-as.

dariosamban avatar dariosamban commented on September 24, 2024

Is there any workarround for this issue that support es2015 config? or is there any update on the fix for this?

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

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

from ngx-export-as.

benjibeaumont avatar benjibeaumont commented on September 24, 2024

@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:

Uncaught SyntaxError: Strict mode code may not include a with statement

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.

from ngx-export-as.

benjibeaumont avatar benjibeaumont commented on September 24, 2024

@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:

Uncaught SyntaxError: Strict mode code may not include a with statement

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.

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

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
Hint: using es5 fix the problem if you do not really care about es2015 you can use it in tsconfig until we fix this issue

from ngx-export-as.

iamade avatar iamade commented on September 24, 2024

@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.

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

@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);
      }
    });
  }

from ngx-export-as.

RoWEN-FCUB avatar RoWEN-FCUB commented on September 24, 2024

Still getting the 'SyntaxError: strict mode code may not contain 'with' statements'. Hope it gets fix soon.

from ngx-export-as.

wnabil avatar wnabil commented on September 24, 2024

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

from ngx-export-as.

Hareem123 avatar Hareem123 commented on September 24, 2024

Hi, I am facing error in date formatting in csv and pdf is giving me empty data .

Capture
a6-11ea-840b-dbe4105ea458.png)

What could be the issue? Whereas my Datatable is showing the correct format .

from ngx-export-as.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.