Good day! I've got errors Uncaught TypeError: setting getter-only property "todo"
and Uncaught TypeError: lib is undefined
. My assumption is that those errors appear when I created a new module for local storage API.
I moved specific functions of local storage to that module.
When the whole code stored in the global scope, app functions fine without issues. The syntax for named export/import is correct.
The code from storage module:
export let todo = JSON.parse(localStorage.getItem("todo-list"));
export function setLocalStorage() {
localStorage.setItem("todo-list", JSON.stringify(todo));
}
How it's imported:
import { todo, setLocalStorage } from "./modules/storageModule";
You can check my repository here
Top comments (2)
ApkTodoDesbloqueado is the ideal site for mod apks that offer you everything unlocked in your favorite games . Enjoy enhanced gaming experiences with fast and direct downloads from our vast collection of game mods.
Sometimes these errors may appear but can be easily soved.
Some comments have been hidden by the post's author - find out more