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

TypeError: Cannot read properties of undefined (reading 'log') #335

Closed
weilinzung opened this issue Apr 26, 2023 · 5 comments · Fixed by #337
Closed

TypeError: Cannot read properties of undefined (reading 'log') #335

weilinzung opened this issue Apr 26, 2023 · 5 comments · Fixed by #337

Comments

@weilinzung
Copy link

We are keep getting this error from vscroll lib.

Uncaught (in promise) Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'log')
TypeError: Cannot read properties of undefined (reading 'log')
    at vscroll.esm5.js:5168:20

https://github.com/dhilt/vscroll/blob/5ebbe79497bc90594885b792d04dd9868f641582/src/classes/adapter.ts#L515

Not too sure if because in this wrapper that doesn't export the logger?

Screenshot 2023-04-26 at 12 31 36 PM

@dhilt
Copy link
Owner

dhilt commented Apr 26, 2023

@weilinzung It looks like a serious issue. Loosing a context. Do you call the Adapter.reset method at some moment or destroy/re-create the component containing the Scroller? Could you please attach dev-log of the failing run? I need to understand which processes have led to this point.

  devSettings: {
    debug: true,
    logProcessRun: true
  }

Also, if it is possible, could you provide minimal runnable demo (like by forking this stackblitz)? This would be the best option for me to investigate the issue.

@weilinzung
Copy link
Author

@dhilt, we do call reset method in some usages. It is very complex for our usage, let me do the debugging first. Then I will get back to you. thank you for your quick response.

@weilinzung
Copy link
Author

@dhilt It is the issue of calling Adapter.reset . We basically listen to the data changes from the backend, then call the reset.

      const newDatasource = this.createDataSource(newIndex);
      await this.dataSource.adapter.reset(newDatasource);

@dhilt
Copy link
Owner

dhilt commented Apr 27, 2023

@weilinzung Ok, still waiting for dev logs 🙂

@dhilt
Copy link
Owner

dhilt commented May 8, 2023

ngx-ui-scroll v3.0.2 contains fix related to this issue, though I'm not sure if it covers the initial case, so, please open a new PR if the problem still occurs.

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

Successfully merging a pull request may close this issue.

2 participants