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

TypeError: Cannot read property 'gzip' of undefined #69

Closed
evdama opened this issue Mar 30, 2020 · 8 comments
Closed

TypeError: Cannot read property 'gzip' of undefined #69

evdama opened this issue Mar 30, 2020 · 8 comments

Comments

@evdama
Copy link

evdama commented Mar 30, 2020

Screen Shot 2020-03-30 at 21 52 21

and that's the section where it throws

  const getAvailableSizeOptions = (options) => {
    const availableSizeProperties = ["renderedLength"];
    if (options.gzip) {
      availableSizeProperties.push("gzipLength");
    }
    if (options.brotli) {
      availableSizeProperties.push("brotliLength");
    }

    return availableSizeProperties;
  };

as well as here

    const availableSizeProperties = getAvailableSizeOptions(options);
@btd
Copy link
Owner

btd commented Mar 31, 2020

Fixed in 4.0.2

@btd btd closed this as completed Mar 31, 2020
@evdama
Copy link
Author

evdama commented Mar 31, 2020

The gzip one is fixed but now there's another one
Screen Shot 2020-03-31 at 13 10 21

@btd
Copy link
Owner

btd commented Mar 31, 2020

Ok, now i need more details. Can you share your html?

@btd btd reopened this Mar 31, 2020
@evdama
Copy link
Author

evdama commented Mar 31, 2020

@btd
Copy link
Owner

btd commented Apr 3, 2020

Fixed.

@btd btd closed this as completed Apr 3, 2020
btd added a commit that referenced this issue Apr 3, 2020
btd added a commit that referenced this issue Apr 8, 2020
@inspire22
Copy link

Using version 5.9.0 I'm also getting this error. It looks like it's set (to false) in const options, but I don't know why this function doesn't have acccess to it anymore.

stats.html:655
Uncaught TypeError: Cannot read properties of undefined (reading 'gzip')

const getAvailableSizeOptions = (options) => {
const availableSizeProperties = ["renderedLength"];
if (options.gzip) {
availableSizeProperties.push("gzipLength");
}
if (options.brotli) {
availableSizeProperties.push("brotliLength");
}
return availableSizeProperties;
};

@btd
Copy link
Owner

btd commented Feb 25, 2023 via email

@inspire22
Copy link

My apologies, I tested more and now it's working. I believe the confusion of where the file ends up (stats.html in the base directory_ led me to find a stats.html that maybe I made when trying this ages ago? I'm not sure, besides that it's working now, thanks :)

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

3 participants