Uncaught SyntaxError: redeclaration of let ffDecryptObj
Hi @charlot, the current documentation about FlexForm and the way it supports JSON can be a tad confusing at times and does not appear to be complete. To maybe help new users, I began writing a new tutorial and tested the code examples, but could not get either a _create
or _edit
form work reliably.
- Downloaded and installed the latest 1.39 branch (v2.1.25), with the config setting .
$wgFlexFormConfig['renderonlyapprovedforms'] = false;
. - Tested the _create example from the tutorial.
What happens
- The
_instance
section does not load at all, or only (temporarily) following a page refresh. - The title field is sometimes prefilled with the current 'fullpagename', which is odd and perhaps unrelated.
- Error reported in browser's console:
Uncaught SyntaxError: redeclaration of let ffDecryptObj <anonymous> .../FlexForm/Modules/FlexForm.general.js:1
- Same issue with an older version of FF (v2.1.8), but MW branch is unclear
- No such issue on nw-wsform with MW1.35.10 and FF v2.1.24
Update
After I changed let to var, a similar error emerged: Uncaught SyntaxError: redeclaration of const ffTempex
.
Since it's working on nw-wsform (1.35) and I can get it working on 1.39 after a solid page refresh, it's likely related to parser cache. Something like {{#ifingroup:user|}}
invalidates parser cache and adding to that page appears to fix it for me.
The documentation does recommend to set $wgParserCacheType = CACHE_NONE
, which I hadn't done myself (RTFM!). Seems worth adding to a troubleshooting page though.