zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

(Bug report) Word count widget failed with error #3463

Closed iSwiftLiu closed 1 year ago

iSwiftLiu commented 1 year ago

Trilium Version

0.58.1-beta

What operating system are you using?

Windows

What is your setup?

Server access only

Operating System Version

Windows 11

Description

Every time the page is refreshed. image

Execution of JS note "Word count widget" with ID ArmCTJ9TYZ6g failed with error: Load of script note "Word count widget" (ArmCTJ9TYZ6g) failed with: Class extends value undefined is not a constructor or null

Error logs

Backend:

15:54:30.804 Keyboard action showNoteInfo found in database, but not in action definition.
15:54:30.804 Keyboard action showLinkMap found in database, but not in action definition.
15:54:30.804 Keyboard action focusOnAttributes found in database, but not in action definition.
15:54:30.804 Keyboard action toggleZenMode found in database, but not in action definition.
15:54:30.805 304 GET /api/keyboard-actions with 11935 bytes took 1ms
15:54:30.934 JS Error: Execution of JS note "Word count widget" with ID ArmCTJ9TYZ6g failed with error: Load of script note "Word count widget" (ArmCTJ9TYZ6g) failed with: Class extends value undefined is not a constructor or null^M
Stack: Error
    at Object.k [as logError] (https://my.trilium.domain/assets/v0.58.1-beta/app-dist/desktop.js:2:103287)
    at Object.showAndLogError (https://my.trilium.domain/assets/v0.58.1-beta/app-dist/desktop.js:2:88360)
    at executeBundle (https://my.trilium.domain/assets/v0.58.1-beta/app-dist/desktop.js:2:36532)
    at async Object.getWidgetBundlesByParent (https://obi.xsage.cn/assets/v0.58.1-beta/app-dist/desktop.js:2:37345)
15:54:30.934 JS Error: Widget initialization failed: ^M
Stack: Error
    at k (https://my.trilium.domain/assets/v0.58.1-beta/app-dist/desktop.js:2:103287)
    at Object.getWidgetBundlesByParent (https://my.trilium.domain/assets/v0.58.1-beta/app-dist/desktop.js:2:37386)
15:54:30.987 304 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 1ms
15:54:31.063 200 POST /api/tree/load with 6039 bytes took 1ms
15:54:31.170 200 POST /api/tree/load with 20341 bytes took 1ms
zadam commented 1 year ago

Hello, the word count widget is an example coming from the older version of Trilium. In 0.58 there was a breaking change described here: https://github.com/zadam/trilium/releases/tag/v0.58.1-beta

You can fix the widget easily by changing the widget:

image

iSwiftLiu commented 1 year ago

Thank you very much, it is indeed no error now.