Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I've got errors Uncaught TypeError: setting getter-only property "todo" and Uncaught TypeError: lib is undefined. I assume that those errors appeared when I created a new module for local sto...
#3: Post edited
- I've got errors
- > `Uncaught TypeError: setting getter-only property "todo"` and `Uncaught TypeError: lib is undefined`.
- I assume that those errors appeared when I created a new module for local storage API.
- I moved specific functions of local storage to that module.
- When the whole code is stored in the global scope, the app functions without issues. The syntax for named export/import is correct.
- You can check my [repository here](https://github.com/DanMarkov/todo-app)
- I've got errors
- > `Uncaught TypeError: setting getter-only property "todo"` and `Uncaught TypeError: lib is undefined`.
- I assume that those errors appeared when I created a new module for local storage API.
- I moved specific functions of local storage to that module.
- When the whole code is stored in the global scope, the app functions 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](https://github.com/DanMarkov/todo-app)
#2: Post edited
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.- You can check my [repository here](https://github.com/DanMarkov/todo-app)
- I've got errors
- > `Uncaught TypeError: setting getter-only property "todo"` and `Uncaught TypeError: lib is undefined`.
- I assume that those errors appeared when I created a new module for local storage API.
- I moved specific functions of local storage to that module.
- When the whole code is stored in the global scope, the app functions without issues. The syntax for named export/import is correct.
- You can check my [repository here](https://github.com/DanMarkov/todo-app)
#1: Initial revision
Webpack can't recognize modules
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. You can check my [repository here](https://github.com/DanMarkov/todo-app)