FMaz008 / VineHelper

Browser extension to improve Vine Experience
https://www.vinehelper.ovh
MIT License
32 stars 23 forks source link

Uncaught Exception - Notification.js call to ScreenNotifier.js #84

Closed testingillusions closed 5 months ago

testingillusions commented 5 months ago

When loading on chrome, get the following error in the Notifications Script on startup.

notifications.js:192 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'push') at showRuntime (notifications.js:192:11) at TemplateMgr.loadTemplateFromFile (Template.js:90:3) at TemplateMgr.getTemplate (Template.js:80:27) at Template.loadFile (Template.js:13:17) at ScreenNotifier.init (ScreenNotifier.js:59:27) at new ScreenNotifier (ScreenNotifier.js:49:8) at notifications.js:32:21

Believe the fix would be to add the ShowRuntime function to the TemplateMgr.js code, but need to research more.

FMaz008 commented 5 months ago

What version of VineHelper are you using?

testingillusions commented 5 months ago

I synced and pulled down the code last night.

I'll investigate more to see if it is a local issue or something that also happens with the chromestore version.

FMaz008 commented 5 months ago

Can you try pulling the code again? I made a change of that code not so long ago

testingillusions commented 5 months ago

ensured that I was in sync with your main branch, last commit e3371bff49cc831f8cfea41b2349532d57235ef4 ran 'yarn' again out put: yarn install v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... warning "@commitlint/cli > @commitlint/load > cosmiconfig-typescript-loader@5.0.0" has unmet peer dependency "@types/node@*". warning "@commitlint/cli > @commitlint/load > cosmiconfig-typescript-loader@5.0.0" has unmet peer dependency "typescript@>=4". [4/4] Building fresh packages... success Saved lockfile. $ husky Done in 8.21s.

reloaded plugin in Windows - Chrome Version 123.0.6312.86 (Official Build) (64-bit)

Same error as present.

Swapped to Chrome Store Version 2.4.10 Error is not seen. Looking at the code, it looks like there is a different version of pages/notifications.js in the uploaded version.

The showRuntime(eventName) function looks like this: function showRuntime(eventName) { // arrDebug.push({ time: Date.now() - startTime, event: eventName }); }

FMaz008 commented 5 months ago

Something doesn't add up. Your showRuntime function would not give the error if it was commented. (Which you can do as it's useless at the moment).

It should look lile this: https://github.com/FMaz008/VineHelper/blob/e3371bff49cc831f8cfea41b2349532d57235ef4/page/notifications.js#L192

testingillusions commented 5 months ago

The one on Github (and local) does not have it commented, however, the Chromestore version has it commented.

It looks like it was commented out on 515273c, but then uncommented on f2691b8.

FMaz008 commented 5 months ago

Yeah that's correct. The function needs to exist because the template stuff use it, but up to recently was implemented. I added it back planning on hunting down that high CPU bug.

That's why I was saying that if you pulled the code, it should not be commented, but you could comment it.

The latest PR fix a bug with that line. Are you still having the issue with the latest pulled code?

I don't have access to my laptop right now but I'll look into it asap.

testingillusions commented 5 months ago

No rush, I can comment it out without issue. You can close this issue if it is resolved under something else.

FMaz008 commented 5 months ago

Fixed in latest code base commit bd56dc7f