archiverjs / node-archiver

a streaming interface for archive generation
https://www.archiverjs.com
MIT License
2.8k stars 220 forks source link

archiver does not work on Angular2 #224

Closed dolanmiu closed 7 years ago

dolanmiu commented 7 years ago

This library doesn't seem to work in Angular2

Uncaught TypeError: Cannot read property 'prototype' of undefined
    at patch (graceful-fs.js:166)
    at Object.<anonymous> (graceful-fs.js:27)
    at Object.toString (graceful-fs.js:262)
    at __webpack_require__ (bootstrap 14ca112…:52)
    at Object.<anonymous> (index.js:8)
    at Object.exports.isArray (index.js:156)
    at __webpack_require__ (bootstrap 14ca112…:52)
    at Object.<anonymous> (core.js:14)
    at Object.<anonymous> (core.js:906)
    at __webpack_require__ (bootstrap 14ca112…:52)
    at Object.<anonymous> (index.js:8)
    at __webpack_require__ (bootstrap 14ca112…:52)
    at Object.537 (app.component.ts:4)
    at __webpack_require__ (bootstrap 14ca112…:52)
    at Object.538 (app.component.ts:17)

screen shot 2017-03-11 at 21 41 47

Here is a plunker:

https://plnkr.co/edit/K97cNlZe9rA0wBOy2Mz2?p=preview

dehimer commented 7 years ago

I think library should work on REST API layer.

dolanmiu commented 7 years ago

I am creating a library to generate word documents with the use of archiver:

https://github.com/dolanmiu/docx

At the moment, you can only generate word documents server side. But there was a feature request asking word documents to be created on the front end.

This is why I ask.

If there is actual technical limitations, and security limitations, then I guess this can't be helped!

dehimer commented 7 years ago

I think its work only on nodejs. Becouse it use libraries, that available only in node. You can open sources and look, what is it required. As example fs library not available in browser. But mb I'm wrong.

ctalkington commented 7 years ago

looks like graceful fs could be a culprit here. i dont work with angular enough to know its limitations but i suspect it has to do with some modules being primarily written for node.

Karnith commented 6 years ago

Is it possible to use BrowserFS as a fill in replacement for grateful fs so this package could be used in browser? Then possibly docx library could use this for generating documents in the browser.. There is JSZip as well for working with zip files.