TiddlyWiki5 icon indicating copy to clipboard operation
TiddlyWiki5 copied to clipboard

[BUG] TypeError: value.toString is not a function

Open ittayd opened this issue 2 years ago • 5 comments

Describe the bug

This issue manifests itself after a weird interaction that I'll describe below. The bottom line is that a json field causes the exception in the subject and after that the wiki becomes unusable: cannot delete the field, tiddler or anything as the error keeps popping.

It happens in $:/core/modules/tiddler.js in the method getFieldString as the value of the field doesn't have the 'toString' method.

Attached is a wiki where this happens (try to edit a tiddler)

Expected behavior

No response

To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots

No response

TiddlyWiki Configuration

  • Version [e.g. v5.1.24]
  • Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc]
  • Plugins installed [e.g. Freelinks, TiddlyMap]

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

No response

ittayd avatar May 23 '22 06:05 ittayd

error.zip

ittayd avatar May 23 '22 06:05 ittayd

The bottom line is that a json field causes the exception in the subject and after that the wiki becomes unusable:

Which field in which tiddler, what is the content of this field?

Can you please provide steps to reproduce the problem in an empty TiddlyWiki file?

saqimtiaz avatar May 23 '22 07:05 saqimtiaz

(Note that I attached a wiki that has the error manifested) The tiddler is $:/plugins/Gk0Wk/TW5-CodeMirror-Enhanced/config.json, the field is 'cache' (but note it also happened in a field named 'fields' in another wiki). image

ittayd avatar May 23 '22 07:05 ittayd

It turns out 'cache' is the field that causes the exception if I edit config.json, but if I create a new tiddler and save, then the exception is in the field 'fields' in config.json image

ittayd avatar May 23 '22 07:05 ittayd

@ittayd thanks, I think jsontiddler module should provide a stringify method for fields field, or ignore the fields field.

截屏2022-05-26 11 30 12

截屏2022-05-26 11 31 55

截屏2022-05-26 11 30 59

linonetwo avatar May 26 '22 03:05 linonetwo