Devextreme-angular: 16.2.1-alpha.1: Module not found: Error: Can't resolve 'jszip' in \node_modules\devextreme\client_exporter

Created on 21 Oct 2016  路  7Comments  路  Source: DevExpress/devextreme-angular

I'm getting the following error with 16.2.1-alpha.1

ERROR in ./~/devextreme/client_exporter/excel_creator.js
Module not found: Error: Can't resolve 'jszip' in 'C:\temp\test-issue\node_modules\devextreme\client_exporter'
 @ ./~/devextreme/client_exporter/excel_creator.js 15:12-28
 @ ./~/devextreme/client_exporter.js
 @ ./~/devextreme/viz/core/export.js
 @ ./~/devextreme/viz/chart_components/base_chart.js
 @ ./~/devextreme/viz/chart.js
 @ ./~/devextreme-angular2/ui/chart.js
 @ ./~/devextreme-angular2/index.js
 @ ./src/app/app.module.ts
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main

I'm using angular-cli with this setup:

// angular-cli.json
      "scripts": [
        "../node_modules/jquery/dist/jquery.min.js",
        "../node_modules/devextreme/dist/js/dx.all.js"
      ],

// app.module.ts
  imports: [
    BrowserModule,
    (...)
    DevExtremeModule
  ],

In 16.1.7 this works fine.

I also tried to change the scripts section of angular-cli.json to

// angular-cli.json
      "scripts": [
        "../node_modules/jquery/dist/jquery.min.js",
        "../node_modules/devextreme/dist/js/jszip.min.js",
        "../node_modules/devextreme/dist/js/dx.all.js"
      ],

but the problem remains.

bug

Most helpful comment

I am still getting this issue in version 18.1.3 ?

All 7 comments

Hello,

In 16.2.1-alpha.1, it is no longer required to include the following scripts as global into angular-cli.json:

      "scripts": [
        "../node_modules/jquery/dist/jquery.min.js",
        "../node_modules/devextreme/dist/js/jszip.min.js",
        "../node_modules/devextreme/dist/js/dx.all.js"
      ],

All devextreme-angular2 dependencies will be loaded by the module loading mechanism.

See also: #178

Sorry @kvet but I removed all scripts from angular-cli.json and the problem remains.

Please see the attached sample gh177-issue.zip. This is a clean project created with

ng init
npm install [email protected] --save

and added DevExtremeModule to app.module.ts.

Running ng serve gives the error

ERROR in ./~/devextreme/client_exporter/excel_creator.js
Module not found: Error: Can't resolve 'jszip' in 'C:\Temp\gh177-issue\node_modules\devextreme\client_exporter'
 @ ./~/devextreme/client_exporter/excel_creator.js 15:12-28
 @ ./~/devextreme/client_exporter.js
 @ ./~/devextreme/ui/data_grid/ui.data_grid.export_controller.js
 @ ./~/devextreme/ui/data_grid/ui.data_grid.js
 @ ./~/devextreme/ui/data_grid.js
 @ ./~/devextreme-angular2/ui/data-grid.js
 @ ./~/devextreme-angular2/index.js
 @ ./src/app/app.module.ts
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main

Same issue here

Hello!

Some of our components depend on the "jszip" library. When you use DevExtremeModule, you need to add the "jszip" library to your project. You can do this with npm:

npm install jszip --save

I am still getting this issue in version 18.1.3 ?

I am getting this error as well in version 18.1.3

I'm getting same error in 18.1.6 for command devextreme-bundler

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alert83 picture alert83  路  7Comments

felpel picture felpel  路  6Comments

keserwan picture keserwan  路  9Comments

Angelminster picture Angelminster  路  6Comments

Cito picture Cito  路  5Comments