skip to Main Content

TypeError: Cannot read properties of undefined (reading ‘toString’)
at C:UsersNeeda AnsariDesktopReact Projectsmyjewelnode_moduleswebpacklibcachePackFileCacheStrategy.js:1243:53
at async Promise.all (index 42)

Node.js v18.15.0[enter image description here](https://phpout.com/wp-content/uploads/2023/06/1VzYK.png)

how to resolve this error? what is the error about

store(identifier, etag, data) {
        if (this.readonly) return Promise.resolve();
        // the error is in the line below
        return this._getPack().then(pack => {
            pack.set(identifier, etag === null? null : etag.toString(), data);
        });
    }

2

Answers


  1. try

    etag === null || undefined ? null : etag.toString()
    
    Login or Signup to reply.
  2. try
    typeof etag === 'undefined' ? null : etag.toString()

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search