wnabil / ngx-export-as

Angular 2+ / Ionic 2+ HTML/table element to export it as JSON, XML, PNG, CSV, TXT, MS-Word, Ms-Excel, PDF
MIT License
68 stars 40 forks source link

Error: webpack < 5 (Angular 12) #100

Closed JoeWorker closed 3 years ago

JoeWorker commented 3 years ago

Hey guys.

Trying out the lib. After installing & importing it, the following error occurs when you run the "ng serve" command:

Error: Module not found: Error: Can't resolve 'util' in 'C:\blabla...projecy_dir\node_modules\xmlbuilder2\lib\builder'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
        - install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }
Angular CLI: 12.2.11
Node: 14.18.1
Package Manager: npm 7.10.0
OS: win32 x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1202.11 (cli-only)
@angular-devkit/core         12.2.11 (cli-only)
@angular-devkit/schematics   12.2.11 (cli-only)
@schematics/angular          12.2.11 (cli-only)

Is this standard? What am I missing 0_o

wnabil commented 3 years ago

https://github.com/wnabil/ngx-export-as/issues/99

JoeWorker commented 3 years ago

lol, thnx let me have a look! ;)

JoeWorker commented 3 years ago

npm install util

takes away the error, but now it sits in the browser...

Uncaught ReferenceError: process is not defined 94655 util.js:109 Webpack 23 webpack_require 26542 webpack_require 48445 webpack_require 93474 webpack_require 63607 webpack_require 42066 webpack_require 54443 webpack_require 36747 webpack_require 14431 webpack_require webpack_exec

O webpackJsonpCallback I'll move along for now :-/