Skip to content
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

gzip has no method zip #1

Open
benzmuircroft opened this issue Jan 14, 2014 · 14 comments
Open

gzip has no method zip #1

benzmuircroft opened this issue Jan 14, 2014 · 14 comments

Comments

@benzmuircroft
Copy link

I've npm installed jsoncomp

but something is wrong...

I can do JSONC.compress and JSONC.decompress they both worked strait away no problem. all I needed to do was

var JSONC=require('jsoncomp/src/JSONC.js') 

But as soon as tired to do JSON.pack it would say Base64 is undefined

So I went into JSONC.js and added

var Base64=null;

  isNodeEnvironment = typeof exports === 'object' && typeof module === 'object' && typeof module.exports === 'object' && typeof require === 'function';
  if(isNodeEnvironment===true){
    Base64=require('../vendor/base64.js');
    }

then it says it the same about gzip, so i do the same with gzip...

then it says gzip has no method zip!?

console.dir says gzip looks like this:

{ gzip:
   { zip: [Function: zip],
     unzip: [Function: unzip],
     DEFAULT_LEVEL: [Getter] } }

What is wrong? Are there instructions to start using this?

@vivekkrbajpai
Copy link

I got the same error on JSONC.pack

@tcorral
Copy link
Owner

tcorral commented Jul 20, 2014

I'll check it. Thanks

@mikeymckay
Copy link

I'm also having this problem. It's not clear how to make this work with node.

@tcorral
Copy link
Owner

tcorral commented Nov 11, 2014

I'll check it this evening, thanks for your support. :)

2014-11-11 14:44 GMT+01:00 Mike McKay [email protected]:

I'm also having this problem. It's not clear how to make this work with
node.


Reply to this email directly or view it on GitHub
#1 (comment).

@mikeymckay
Copy link

I had to patch in the Base64 as @benzmuircroft, but I didn't get to the point of having to patch in gzip.

Here's a gist
https://gist.github.com/mikeymckay/a0c38311f0dcfebcb635

And this is the first part of the error:

coffee unpack.coffee
TypeError: Object # has no method 'decode'
at Object. (/var/www/couchdbsqueeze/public/JSONC.js:8:22)

@PSeitz
Copy link

PSeitz commented Apr 6, 2015

I have the same issue:

C:\Development\japanese-dictionary\node_modules\jsoncomp\src\JSONC.js:275
return Base64.encode(String.fromCharCode.apply(String, gzip.zip(str,{level
^
ReferenceError: Base64 is not defined

@mmcdermott
Copy link

Issue is still present, if anyone out there runs into this in the future.

@isneezy
Copy link

isneezy commented Feb 7, 2017

Till now the problem persists :(

@WitoldSlawko
Copy link

Unfortunately I struggle with same issue. Using script as CDN, works fine. But setting it up in Node is troublesome.

@prestto
Copy link

prestto commented Oct 22, 2018

issue still persisting

@mohsad06
Copy link

mohsad06 commented Nov 9, 2018

I have the same issue using javascript

@JimZeeKing
Copy link

Same issue with npm jscomp with browserify:
Uncaught ReferenceError: Base64 is not defined
at Object.JSONC.pack (bundle.js:1636)

@TAnas0
Copy link

TAnas0 commented Mar 6, 2019

To anyone stumbling on this issue, you can find a hacky fix suggested in the issue /issues/7 wich resolves the Base64 and Gzip dependency problems.

Also, @tcorral, could you please update us on the state of this repository? I see a lot of potential for this project, but looking through the issues and merge requests, this project seems unmaintained. Maybe you need the help of other contributors. If so, some contributing guidelines and a few documentation changes would go a long way.

Thanks in advance

@mikeymckay
Copy link

mikeymckay commented Mar 7, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests