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) Right click menu on note does not work with subpath reverse proxy #3452

Closed TheAceBlock closed 1 year ago

TheAceBlock commented 1 year ago

Trilium Version

0.57.5

What operating system are you using?

Other Linux

What is your setup?

Server access only

Operating System Version

Linux, Firefox 108 and Windows 10, Chrome 108

Description

On a server install with reverse proxy on a subpath like shown in the wiki, if you try to right-click on any note on the note tree, no menu would show up, and the console will show an error, which shows that Trilium tried to fetch the assets file from the base URL path (/) rather than the configured subpath (/trilium/):

Screenshot

Upon reading the code some bit, it seems that this WebPack configuration might be the one to blame, although I'm not familiar with WebPack and Node.js stuff. A similar bug can be spotted as well where after setting the password in the initial setup, the app redirects to the base URL / rather than the app entry, which could have something to do with this, with a potential fix here, but I'm just guessing based on my past experiences.

Error logs

Uncaught (in promise) ChunkLoadError: Loading chunk 893 failed.
(error: https://example.com/assets/v0.57.5/app-dist/893.desktop.js)
    j jsonp chunk loading:27
    e ensure chunk:6
    e ensure chunk:5
    initFancyTree note_tree.js:583
    jQuery 8
    initFancyTree note_tree.js:580
    doRender note_tree.js:235
    render basic_widget.js:79
    doRender container.js:8
    render basic_widget.js:79
    doRender container.js:8
    render basic_widget.js:79
    showWidgets app_context.js:41
    start app_context.js:32
    async* desktop.js:28
    promise callback* desktop.js:26
    <anonymous> desktop.js:142
    <anonymous> desktop.js:142
jsonp chunk loading:27:17
hulmgulm commented 1 year ago

This issue is reproducible in 0.58.0.

zadam commented 1 year ago

Hi, thanks for the report. Both issues fixed on the master branch - future 0.58.1. Not sure if I will make another 0.57.X release.