Pages with markdown comments not updating
Description
👉 edit: see comment below for actual cause
Single pages in the wiki are not updating anymore (2 pages out of about 100 so far)
Changes are visible in markdown preview and page source (markdown), but not in the actual live wiki view / reading mode.
Troubleshooting attempts
1. Copy content to new page
I tried to create a new page and add the same markdown content, but immediately upon creation and closing edit mode I get redirected to a screen with
Error while fetching page. Duplicate entry detected. Reload the page to try again.
2. Remove, then re-add content
- copy markdown, remove entire content, add some text instead (one line)
- page finally updates (works)
- return to edit and add original markdown back --> page does not update anymore
to do: incrementally add original markdown (piece by piece) and see when page breaks / stops updating (see comment below)
System Infos
Question
What could be causing this? (sorry for limited information to reproduce. I will update if I find out more)
Update
Seems like wiki does not allow comments in markdown (removing these solved updating issue for both pages).
I was using the following comment formatting:
<!---
markdown comment here
blablabla
--->
Possible fixes
- UI fix: Markdown editor gives a warning when adding comments in this format
- Actual fix: Allow these types of comments to be added in markdown and still render page correctly
We have the same issue where a page seemingly had the correct LAST EDITED BY field showing Today at 9:30 AM, but the updates made were not shown when the page was rendered. Following.
Not the right solution but I was able to hide a block of content using a <div> with a class, witch this class has the display: none propriety.
I concur - if a markdown page has an HTML comment embedded, the page will fail to render. In my case, for a succesful page the server reports:
2021-05-02T11:40:51.136Z [JOB] info: Rendering page ID 40...
2021-05-02T11:40:52.180Z [JOB] info: Using database driver pg for postgres [ OK ]
2021-05-02T11:40:55.703Z [JOB] info: Rendering page ID 40: [ COMPLETED ]
2021-05-02T11:40:55.790Z [MASTER] info: (STORAGE/DISK) Updating file [en] path/to/wikipage...
While a failing page (the same page and content with an added HTML comment - "<!-- XXX -->") reports:
2021-05-02T11:41:10.761Z [JOB] info: Rendering page ID 40...
2021-05-02T11:41:11.759Z [JOB] info: Using database driver pg for postgres [ OK ]
2021-05-02T11:41:13.046Z [JOB] error: Rendering page ID 40: [ FAILED ]
2021-05-02T11:41:13.047Z [JOB] error: Cannot read property 'type' of undefined
2021-05-02T11:41:13.078Z [MASTER] info: (STORAGE/DISK) Updating file [en] path/to/wikipage...
The rendering also fails for previously-successful pages with embedded comments, so this would appear to be a small regression, introduced sometime between 2.5.159 and 2.5.201.
Some relevant discussion has occurred here: #3709.
I can also confirm this issue, however, the UI does not report any kind of render error.
I also have this problem. But not all sites seem to have this problem. 20% or so
$ find . -iname '*.md' | wc -l
1408
$ git grep -i --name-only '<!--' -- '*.md' | wc -l
693
I concur - if a markdown page has an HTML comment embedded, the page will fail to render. In my case, for a succesful page the server reports:
2021-05-02T11:40:51.136Z [JOB] info: Rendering page ID 40... 2021-05-02T11:40:52.180Z [JOB] info: Using database driver pg for postgres [ OK ] 2021-05-02T11:40:55.703Z [JOB] info: Rendering page ID 40: [ COMPLETED ] 2021-05-02T11:40:55.790Z [MASTER] info: (STORAGE/DISK) Updating file [en] path/to/wikipage...While a failing page (the same page and content with an added HTML comment - "") reports:
2021-05-02T11:41:10.761Z [JOB] info: Rendering page ID 40... 2021-05-02T11:41:11.759Z [JOB] info: Using database driver pg for postgres [ OK ] 2021-05-02T11:41:13.046Z [JOB] error: Rendering page ID 40: [ FAILED ] 2021-05-02T11:41:13.047Z [JOB] error: Cannot read property 'type' of undefined 2021-05-02T11:41:13.078Z [MASTER] info: (STORAGE/DISK) Updating file [en] path/to/wikipage...The rendering also fails for previously-successful pages with embedded comments, so this would appear to be a small regression, introduced sometime between 2.5.159 and 2.5.201.
Some relevant discussion has occurred here: #3709.
I have the same problem, this may be a bug on Wiki.js 2.5.201 (upgrade from 2.5.170)
I have the same problem and I would need the "real fix"; the comments are added by a third-party editor (stackedit) and they are crucial there.
I have a Blog in which in comment box show that you can comment by using your Facebook profile. How can i remove this?
This was fixed by a recent PR. A new build will be released soon but in the meantime you can use this docker image:
requarks/wiki:canary-2.5.206
or apply the patch directly: https://github.com/Requarks/wiki/pull/3823/files
@NGPixel : "This was fixed by a recent PR. A new build will be released soon but in the meantime you can use this docker image:"
When is soon? This was 3 months ago. I'm at 2.5.201. I got bit by this over the past week. Wasted 4 days trying to figure out what was going on. :(
BTW: Love the Wiki!