Code Monkey home page Code Monkey logo

Comments (8)

netanel-haber avatar netanel-haber commented on June 12, 2024 1

I've tested it in multiple environments including entirely new projects. I've also used the node max_old_space_size env with as much as 8GB of ram (It should be noted that it isn't the browser tab that crashes, it's the actual dev process).

The problem isn't some absolute minimum memory footprint - but that like I've mentioned, regardless of the initial max memory constraint, the usage just immediately skyrockets and keeps climbing until hitting the max and crashing the process. This seems to actually stem from a real memory leak that has something to do with webpack-dev-server interop, as running the module in a simple node project (not CRA, just plain old node), causes no problems.

It should also be noted that this hasn't happened to me with the original zxcvbn package, just with zxcvbn-ts.

from zxcvbn.

MrWook avatar MrWook commented on June 12, 2024 1

I don't think it is a direct issue with zxcvbn-ts because it will already crash if you only import the password.js file into a fresh repo. The content of this file is only one variable with a big array.

But it seems like the approach from the original repo is more fit for big data like that. In the original repo those dictionaries are not an array but a string that is splitted on runtime.
I thought it would be a good idea to directly use an array to increase runtime performance but it seems like this comes with a downside for some dev servers 🤔

I will adjust the dictionaries so that they match the original initalization with the split function.
Thanks for the finding 👍

from zxcvbn.

MrWook avatar MrWook commented on June 12, 2024 1

I just release version 1.0.0 with this issue included. In my starter setup for CRA4 it worked now. Can you try it out for youself?

from zxcvbn.

MrWook avatar MrWook commented on June 12, 2024

You need to be aware that the dictionaries are huge there are 2MB of plain old json data.

I can say for myself that i never encountered this issue but i am using vue and nuxt instead of react. On the other side im using webpack for vue and nuxt too.
Does this happen for a new project or do you included it into a bigger project?

from zxcvbn.

MrWook avatar MrWook commented on June 12, 2024

This is weird, there are no functions that could go into a memory leak but i will check it out 🤔

Wich version are you using?

from zxcvbn.

netanel-haber avatar netanel-haber commented on June 12, 2024

I'm using the latest version. Another thing to add is that both JS and TS templates of CRA crashed for me, on different computers as well.

from zxcvbn.

netanel-haber avatar netanel-haber commented on June 12, 2024

Interesting! Thank you.

from zxcvbn.

netanel-haber avatar netanel-haber commented on June 12, 2024

It seems to work now - thank you very much.

from zxcvbn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.