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

[v1.8.0] TypeError: localForage.getItem is not a function #979

Closed
ssuess opened this issue Jul 21, 2020 · 5 comments
Closed

[v1.8.0] TypeError: localForage.getItem is not a function #979

ssuess opened this issue Jul 21, 2020 · 5 comments
Assignees
Labels

Comments

@ssuess
Copy link

ssuess commented Jul 21, 2020

Since upgrading to 1.8.0, I am getting the following errors:

TypeError: localForage.getItem is not a function and TypeError: localForage.clear is not a function

Is there something I need to change in my code with this new version?

Reverting to 1.7.4 fixes the issue (and is what I have done for now)

@ssuess ssuess changed the title v1.8.0: TypeError: localForage.getItem is not a function [v1.8.0] TypeError: localForage.getItem is not a function Jul 21, 2020
@bencefr
Copy link

bencefr commented Jul 21, 2020

localForage.config is not a function either, had to pin the version back to 1.7.4

@sv-22
Copy link

sv-22 commented Jul 21, 2020

yeah, I'm having the same issue when importing in Angular as import * as localforage from "localforage".

Here is a workaround I'm using right now: const localForage = require('localforage').default;

@stefandesu
Copy link

Same issue for me. Too bad this release was published without considering that it (apparently) breaks importing. I'm sure there's still a way of importing it properly (for me, the currently documented way does not work), but nonetheless, a minor release shouldn't cause this issue.

@oguzhankahyaoglu
Copy link

After releasing 1.8.0, our project got broken. Here is the error log of angular 9 project prod build:

"export 'LOCALSTORAGE' (imported as 'localForage') was not found in 'localforage'

Downgrading to 1.7.4 fixed the issue.

@tofumatt tofumatt self-assigned this Jul 21, 2020
@tofumatt
Copy link
Member

Argh, super-sorry about this one, looks like we need more tests for these types of things. I've published 1.8.1 with the ESM change reverted, very sorry about that 😢

So upgrading to 1.8.1 will do the trick. Really sorry about that; I'm working on better integration tests for a new release but they aren't ready yet. I'll make sure this doesn't happen in the future, but it is fixed for now 👍

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

No branches or pull requests

6 participants