<<now>> macro bricks TW

I’ve reproduced this bug on a clean empty TW.

Make a tiddler tagged “$:/tags/StartupAction” and then try to use the now macro with the format in “ddd” or “DDD”. Upon saving and reloading you get the Internal Javascript Error with “Uncaught TypeError: Cannot read properties of undefined (reading ‘getString’)”.

You don’t even need to use an $action-setfield or anything, just calling <<now ddd>> in an otherwise blank tiddler will cause this bug.

It only happens with the date format in “ddd” or “DDD”. I have tried “dddd”, “YYYY”, “0MM” and those are all without problem, haven’t tried every date format yet though.

I suspect the problem is that “ddd” or “DDD” both rely upon retrieving text strings defined in $:/language/Date/* shadow tiddlers, which are apparently not available at the time the StartupAction is being invoked.

If this is the case, then the same problem should also occur for day suffix (DDth), month name (mmm or MMM), and period (am, AM, pm, or PM) date formats, which also need to get their text strings from $:/language/Date/* tiddlers.

As a workaround, you can use $:/tags/StartupAction/PostRender to defer startup processing until after the entire TiddlyWiki user interface has been completely loaded.

-e

Thanks! Your workaround worked.

Are there any other known bugs/instances of when to use PostRender instead of the default StartupAction tag?

Hi @hoopyfrood I think this one of those felicitous occasions where the problem you describe has already been fixed:

The fix is available in the prerelease at https://tiddlywiki.com/prerelease, and will be part of v5.3.7, the next planned release.

2 Likes

Excellent, looking forward to the new release!