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

Window Local Storage mock fn not called. #1625

Open
nada-deriv opened this issue Nov 25, 2024 · 3 comments
Open

Window Local Storage mock fn not called. #1625

nada-deriv opened this issue Nov 25, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@nada-deriv
Copy link

Describe the bug
The local storage function is not called. If I put a console outside the function, the log is shown, but the console inside the function is never shown. I'm using happy-dom as the environment in my vite.config.ts file.

Expected behavior
The local storage function should be called.

Screenshots
Screenshot 2024-11-25 at 7 49 39 PM

@nada-deriv nada-deriv added the bug Something isn't working label Nov 25, 2024
@Releef
Copy link

Releef commented Nov 27, 2024

it seems that this did work in version 15.7.3

@OlaviSau
Copy link
Contributor

OlaviSau commented Dec 9, 2024

It's a bit hard to see how this relates to happy-dom as the localStorage is user defined in this scenario and important context is missing - there is no information on what LocalStorageUtils does. Since that is the only non setup code here, it's practically impossible to advise on this issue without knowing that. Given that this was asked 2 weeks ago with no activity I would assume you found the issue within your codebase and this needs to further action?

@Releef
Copy link

Releef commented Dec 10, 2024

@OlaviSau to be fair, I have this same issue with local storage which did work in 15.7.3. But we had to update the package due to a critical issue, to at least 15.10+ which broke any test with localStorage in them. So there clearly must be a change in the package that is responsible for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants