diff --git a/CHANGES.md b/CHANGES.md
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -22,6 +22,40 @@
 See also the hledger changelog.
 
 
+# 2024-12-09 1.41
+
+Breaking changes
+
+- When built with ghc 9.10.1, error messages are displayed with two extra trailing newlines.
+
+Fixes
+
+- Autocompletions now work in newly created account fields. [#2215]
+
+- Bash shell completions are now up to date. [#986]
+
+Features
+
+Improvements
+
+- Added --pager and --color options as in hledger, affecting command line help.
+
+- Added a new `debug` build flag. Builds made with ghc 9.10+ and this flag
+  will show some kind of partial stack trace if the program exits with an error.
+  These will improve in future ghc versions.
+
+- Disabled the unused `ghcdebug` build flag and ghc-debug support, for now.
+
+- allow megaparsec 9.7
+
+- ghc 9.10 / base 4.20 are now supported.
+
+Docs
+
+- Install, manual: new shell completions doc. [#986]
+
+
+
 # 1.40 2024-09-09
 
 Improvements
diff --git a/Hledger/Web/Handler/MiscR.hs b/Hledger/Web/Handler/MiscR.hs
--- a/Hledger/Web/Handler/MiscR.hs
+++ b/Hledger/Web/Handler/MiscR.hs
@@ -84,7 +84,7 @@
   VD{j} <- getViewData
   require ViewPermission
   selectRep $ do
-    provideJson $ (M.keys . jinferredcommodities) j
+    provideJson $ (M.keys . jinferredcommoditystyles) j
 
 getAccountsR :: Handler TypedContent
 getAccountsR = do
diff --git a/Hledger/Web/Handler/RegisterR.hs b/Hledger/Web/Handler/RegisterR.hs
--- a/Hledger/Web/Handler/RegisterR.hs
+++ b/Hledger/Web/Handler/RegisterR.hs
@@ -9,9 +9,9 @@
 
 module Hledger.Web.Handler.RegisterR where
 
+import qualified Data.List.NonEmpty.Compat as NonEmpty  -- from base-compat for ghc 8.10
 import Data.List (intersperse, nub, partition)
 import qualified Data.Text as T
-import Safe (tailDef)
 import Text.Hamlet (hamletFile)
 
 import Hledger
@@ -42,10 +42,11 @@
           map (\(acct,(name,comma)) -> (acct, (T.pack name, T.pack comma))) .
           undecorateLinks . elideRightDecorated 40 . decorateLinks .
           addCommas . preferReal . otherTransactionAccounts q acctQuery
+      snoc xs x = NonEmpty.prependList xs $ NonEmpty.singleton x
       addCommas xs =
           zip xs $
           zip (map (T.unpack . accountSummarisedName . paccount) xs) $
-          tailDef [""] $ (", "<$xs)
+          NonEmpty.tail $ snoc (", "<$xs) ""
       items =
         styleAmounts (journalCommodityStylesWith HardRounding j) $
         accountTransactionsReport rspec{_rsQuery=q} j acctQuery
diff --git a/Hledger/Web/Main.hs b/Hledger/Web/Main.hs
--- a/Hledger/Web/Main.hs
+++ b/Hledger/Web/Main.hs
@@ -5,6 +5,7 @@
 Released under GPL version 3 or later.
 -}
 
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE MultiWayIf #-}
 {-# LANGUAGE NamedFieldPuns #-}
 {-# LANGUAGE OverloadedStrings #-}
@@ -12,6 +13,9 @@
 module Hledger.Web.Main where
 
 import Control.Exception (bracket)
+#if MIN_VERSION_base(4,20,0)
+import Control.Exception.Backtrace (setBacktraceMechanismState, BacktraceMechanism(..))
+#endif
 import Control.Monad (when)
 import Data.String (fromString)
 import qualified Data.Text as T
@@ -49,13 +53,27 @@
 hledgerWebMain = withGhcDebug' $ do
   when (ghcDebugMode == GDPauseAtStart) $ ghcDebugPause'
 
+#if MIN_VERSION_base(4,20,0)
+  -- Control ghc 9.10+'s stack traces.
+  -- CostCentreBacktrace   - collect cost-centre stack backtraces (only available when built with profiling)
+  -- HasCallStackBacktrace - collect HasCallStack backtraces
+  -- ExecutionBacktrace    - collect backtraces from native execution stack unwinding
+  -- IPEBacktrace          - collect backtraces from Info Table Provenance Entries
+#ifdef DEBUG
+  setBacktraceMechanismState HasCallStackBacktrace True
+#else
+  setBacktraceMechanismState HasCallStackBacktrace False
+#endif
+#endif
+
   -- try to encourage user's $PAGER to properly display ANSI (in command line help)
-  when useColorOnStdout setupPager
+  usecolor <- useColorOnStdout
+  when usecolor setupPager
 
   wopts@WebOpts{cliopts_=copts@CliOpts{debug_, rawopts_}} <- getHledgerWebOpts
   when (debug_ > 0) $ printf "%s\n" prognameandversion >> printf "opts: %s\n" (show wopts)
   if
-    | boolopt "help"            rawopts_ -> pager $ showModeUsage webmode ++ "\n"
+    | boolopt "help"            rawopts_ -> runPager $ showModeUsage webmode ++ "\n"
     | boolopt "tldr"            rawopts_ -> runTldrForPage "hledger-web"
     | boolopt "info"            rawopts_ -> runInfoForTopic "hledger-web" Nothing
     | boolopt "man"             rawopts_ -> runManForTopic  "hledger-web" Nothing
diff --git a/Hledger/Web/Test.hs b/Hledger/Web/Test.hs
--- a/Hledger/Web/Test.hs
+++ b/Hledger/Web/Test.hs
@@ -126,9 +126,10 @@
 
     -- yit "can add transactions" $ do
 
+  usecolor <- useColorOnStdout
   let
     rawopts = [("forecast","")]
-    iopts = rawOptsToInputOpts d $ mkRawOpts rawopts
+    iopts = rawOptsToInputOpts d usecolor True $ mkRawOpts rawopts
     f = "fake"  -- need a non-null filename so forecast transactions get index 0
   pj <- readJournal' (T.pack $ unlines  -- PARTIAL: readJournal' should not fail
     ["~ monthly"
diff --git a/hledger-web.1 b/hledger-web.1
--- a/hledger-web.1
+++ b/hledger-web.1
@@ -1,5 +1,5 @@
 
-.TH "HLEDGER\-WEB" "1" "September 2024" "hledger-web-1.40 " "hledger User Manuals"
+.TH "HLEDGER\-WEB" "1" "October 2024" "hledger-web-1.41 " "hledger User Manuals"
 
 
 
@@ -17,7 +17,7 @@
 .PD
 \f[CR]hledger web \-\- [OPTS] [QUERY]\f[R]
 .SH DESCRIPTION
-This manual is for hledger\[aq]s web interface, version 1.40.
+This manual is for hledger\[aq]s web interface, version 1.41.
 See also the hledger manual for common concepts and file formats.
 .PP
 hledger is a robust, user\-friendly, cross\-platform set of programs for
@@ -166,9 +166,11 @@
   \-C \-\-cleared              include only cleared postings/transactions
                             (\-U/\-P/\-C can be combined)
   \-R \-\-real                 include only non\-virtual postings
-     \-\-depth=NUM            or \-NUM: show only top NUM levels of accounts
   \-E \-\-empty                Show zero items, which are normally hidden.
                             In hledger\-ui & hledger\-web, do the opposite.
+     \-\-depth=DEPTHEXP       if a number (or \-NUM): show only top NUM levels
+                            of accounts. If REGEXP=NUM, only apply limiting to
+                            accounts matching the regular expression.
   \-B \-\-cost                 show amounts converted to their cost/sale amount
   \-V \-\-market               Show amounts converted to their value at period
                             end(s) in their default valuation commodity.
@@ -185,8 +187,6 @@
                             YYYY\-MM\-DD: value on given date
   \-c \-\-commodity\-style=S    Override a commodity\[aq]s display style.
                             Eg: \-c \[aq].\[aq] or \-c \[aq]1.000,00 EUR\[aq]
-     \-\-color=YN \-\-colour    Use ANSI color codes in text output? Can be
-                            \[aq]y\[aq]/\[aq]yes\[aq]/\[aq]always\[aq], \[aq]n\[aq]/\[aq]no\[aq]/\[aq]never\[aq] or \[aq]auto\[aq].
      \-\-pretty[=YN]          Use box\-drawing characters in text output? Can be
                             \[aq]y\[aq]/\[aq]yes\[aq] or \[aq]n\[aq]/\[aq]no\[aq].
                             If YN is specified, the equals is required.
@@ -198,6 +198,8 @@
      \-\-man                  show the manual with man
      \-\-version              show version information
      \-\-debug=[1\-9]          show this much debug output (default: 1)
+     \-\-pager=YN             use a pager when needed ? y/yes (default) or n/no
+     \-\-color=YNA \-\-colour   use ANSI color ? y/yes, n/no, or auto (default)
 .EE
 .PP
 hledger\-web shows accounts with zero balances by default (like
@@ -211,6 +213,10 @@
 Reporting options and/or query arguments can be used to set an initial
 query, which although not shown in the UI, will restrict the data shown
 (in addition to any search query entered in the UI).
+.PP
+If you use the bash shell, you can auto\-complete flags by pressing TAB
+in the command line.
+If this is not working see Install > Shell completions.
 .SH PERMISSIONS
 By default, hledger\-web allows anyone who can reach it to view the
 journal and to add new transactions, but not to change existing data.
@@ -496,7 +502,7 @@
 Default: \f[CR]$HOME/.hledger.journal\f[R].
 .SH BUGS
 We welcome bug reports in the hledger issue tracker (shortcut:
-http://bugs.hledger.org), or on the #hledger chat or hledger mail list
+https://bugs.hledger.org), or on the hledger chat or mail list
 (https://hledger.org/support).
 .PP
 Some known issues:
diff --git a/hledger-web.cabal b/hledger-web.cabal
--- a/hledger-web.cabal
+++ b/hledger-web.cabal
@@ -5,7 +5,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           hledger-web
-version:        1.40
+version:        1.41
 synopsis:       Web user interface for the hledger accounting system
 description:    A simple web user interface for the hledger accounting system,
                 providing a more modern UI than the command-line or terminal interfaces.
@@ -112,16 +112,16 @@
   type: git
   location: https://github.com/simonmichael/hledger
 
+flag debug
+  description: Build with GHC 9.10+'s stack traces enabled
+  manual: True
+  default: False
+
 flag dev
   description: Turn on development settings, like auto-reload templates.
   manual: False
   default: False
 
-flag ghcdebug
-  description: Build with support for attaching a ghc-debug client
-  manual: True
-  default: False
-
 flag library-only
   description: Build for use with "yesod devel"
   manual: False
@@ -156,11 +156,12 @@
   hs-source-dirs:
       ./
   ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns
-  cpp-options: -DVERSION="1.40"
+  cpp-options: -DVERSION="1.41"
   build-depends:
       Decimal >=0.5.1
     , aeson >=1 && <2.3
-    , base >=4.14 && <4.20
+    , base >=4.14 && <4.21
+    , base-compat >=0.14.0
     , base64
     , blaze-html
     , blaze-markup
@@ -177,13 +178,13 @@
     , filepath
     , githash >=0.1.6.2
     , hjsmin
-    , hledger ==1.40.*
-    , hledger-lib ==1.40.*
+    , hledger ==1.41.*
+    , hledger-lib ==1.41.*
     , hspec
     , http-client
     , http-conduit
     , http-types
-    , megaparsec >=7.0.0 && <9.7
+    , megaparsec >=7.0.0 && <9.8
     , mtl >=2.2.1
     , network
     , safe >=0.3.20
@@ -211,10 +212,8 @@
     cpp-options: -DDEVELOPMENT
   if flag(dev)
     ghc-options: -O0
-  if (flag(ghcdebug))
-    cpp-options: -DGHCDEBUG
-    build-depends:
-        ghc-debug-stub >=0.6.0.0 && <0.7
+  if (flag(debug))
+    cpp-options: -DDEBUG
 
 executable hledger-web
   main-is: main.hs
@@ -223,19 +222,18 @@
   hs-source-dirs:
       app
   ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns
-  cpp-options: -DVERSION="1.40"
+  cpp-options: -DVERSION="1.41"
   build-depends:
-      base >=4.14 && <4.20
+      base >=4.14 && <4.21
+    , base-compat >=0.14.0
     , hledger-web
   default-language: Haskell2010
   if (flag(dev)) || (flag(library-only))
     cpp-options: -DDEVELOPMENT
   if flag(dev)
     ghc-options: -O0
-  if (flag(ghcdebug))
-    cpp-options: -DGHCDEBUG
-    build-depends:
-        ghc-debug-stub >=0.6.0.0 && <0.7
+  if (flag(debug))
+    cpp-options: -DDEBUG
   if flag(library-only)
     buildable: False
   if flag(threaded)
@@ -247,16 +245,15 @@
   hs-source-dirs:
       test
   ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns
-  cpp-options: -DVERSION="1.40"
+  cpp-options: -DVERSION="1.41"
   build-depends:
-      base >=4.14 && <4.20
+      base >=4.14 && <4.21
+    , base-compat >=0.14.0
     , hledger-web
   default-language: Haskell2010
   if (flag(dev)) || (flag(library-only))
     cpp-options: -DDEVELOPMENT
   if flag(dev)
     ghc-options: -O0
-  if (flag(ghcdebug))
-    cpp-options: -DGHCDEBUG
-    build-depends:
-        ghc-debug-stub >=0.6.0.0 && <0.7
+  if (flag(debug))
+    cpp-options: -DDEBUG
diff --git a/hledger-web.info b/hledger-web.info
--- a/hledger-web.info
+++ b/hledger-web.info
@@ -1,4 +1,4 @@
-This is hledger-web.info, produced by makeinfo version 7.1 from stdin.
+This is hledger-web.info, produced by makeinfo version 7.1.1 from stdin.
 
 INFO-DIR-SECTION User Applications
 START-INFO-DIR-ENTRY
@@ -18,7 +18,7 @@
 or
 'hledger web -- [OPTS] [QUERY]'
 
-   This manual is for hledger's web interface, version 1.40.  See also
+   This manual is for hledger's web interface, version 1.41.  See also
 the hledger manual for common concepts and file formats.
 
    hledger is a robust, user-friendly, cross-platform set of programs
@@ -171,9 +171,11 @@
   -C --cleared              include only cleared postings/transactions
                             (-U/-P/-C can be combined)
   -R --real                 include only non-virtual postings
-     --depth=NUM            or -NUM: show only top NUM levels of accounts
   -E --empty                Show zero items, which are normally hidden.
                             In hledger-ui & hledger-web, do the opposite.
+     --depth=DEPTHEXP       if a number (or -NUM): show only top NUM levels
+                            of accounts. If REGEXP=NUM, only apply limiting to
+                            accounts matching the regular expression.
   -B --cost                 show amounts converted to their cost/sale amount
   -V --market               Show amounts converted to their value at period
                             end(s) in their default valuation commodity.
@@ -190,8 +192,6 @@
                             YYYY-MM-DD: value on given date
   -c --commodity-style=S    Override a commodity's display style.
                             Eg: -c '.' or -c '1.000,00 EUR'
-     --color=YN --colour    Use ANSI color codes in text output? Can be
-                            'y'/'yes'/'always', 'n'/'no'/'never' or 'auto'.
      --pretty[=YN]          Use box-drawing characters in text output? Can be
                             'y'/'yes' or 'n'/'no'.
                             If YN is specified, the equals is required.
@@ -203,6 +203,8 @@
      --man                  show the manual with man
      --version              show version information
      --debug=[1-9]          show this much debug output (default: 1)
+     --pager=YN             use a pager when needed ? y/yes (default) or n/no
+     --color=YNA --colour   use ANSI color ? y/yes, n/no, or auto (default)
 
    hledger-web shows accounts with zero balances by default (like
 'hledger-ui', and unlike 'hledger').  Using the '-E/--empty' flag will
@@ -215,6 +217,10 @@
 initial query, which although not shown in the UI, will restrict the
 data shown (in addition to any search query entered in the UI).
 
+   If you use the bash shell, you can auto-complete flags by pressing
+TAB in the command line.  If this is not working see Install > Shell
+completions.
+
 
 File: hledger-web.info,  Node: PERMISSIONS,  Next: EDITING UPLOADING DOWNLOADING,  Prev: OPTIONS,  Up: Top
 
@@ -513,7 +519,7 @@
 ******
 
 We welcome bug reports in the hledger issue tracker (shortcut:
-http://bugs.hledger.org), or on the #hledger chat or hledger mail list
+https://bugs.hledger.org), or on the hledger chat or mail list
 (https://hledger.org/support).
 
    Some known issues:
@@ -522,25 +528,16 @@
 
 
 Tag Table:
-Node: Top223
-Node: OPTIONS2566
-Ref: #options2671
-Node: PERMISSIONS10945
-Ref: #permissions11084
-Node: EDITING UPLOADING DOWNLOADING12296
-Ref: #editing-uploading-downloading12477
-Node: RELOADING13311
-Ref: #reloading13445
-Node: JSON API13878
-Ref: #json-api13993
-Node: DEBUG OUTPUT19527
-Ref: #debug-output19652
-Node: Debug output19679
-Ref: #debug-output-119780
-Node: ENVIRONMENT20197
-Ref: #environment20316
-Node: BUGS20433
-Ref: #bugs20517
+Node: Top225
+Node: OPTIONS2568
+Node: PERMISSIONS11257
+Node: EDITING UPLOADING DOWNLOADING12608
+Node: RELOADING13623
+Node: JSON API14190
+Node: DEBUG OUTPUT19839
+Node: Debug output19991
+Node: ENVIRONMENT20509
+Node: BUGS20745
 
 End Tag Table
 
diff --git a/hledger-web.txt b/hledger-web.txt
--- a/hledger-web.txt
+++ b/hledger-web.txt
@@ -11,7 +11,7 @@
        hledger web -- [OPTS] [QUERY]
 
 DESCRIPTION
-       This manual is for hledger's web interface, version 1.40.  See also the
+       This manual is for hledger's web interface, version 1.41.  See also the
        hledger manual for common concepts and file formats.
 
        hledger is a robust, user-friendly, cross-platform set of programs  for
@@ -148,9 +148,11 @@
                 -C --cleared              include only cleared postings/transactions
                                           (-U/-P/-C can be combined)
                 -R --real                 include only non-virtual postings
-                   --depth=NUM            or -NUM: show only top NUM levels of accounts
                 -E --empty                Show zero items, which are normally hidden.
                                           In hledger-ui & hledger-web, do the opposite.
+                   --depth=DEPTHEXP       if a number (or -NUM): show only top NUM levels
+                                          of accounts. If REGEXP=NUM, only apply limiting to
+                                          accounts matching the regular expression.
                 -B --cost                 show amounts converted to their cost/sale amount
                 -V --market               Show amounts converted to their value at period
                                           end(s) in their default valuation commodity.
@@ -167,8 +169,6 @@
                                           YYYY-MM-DD: value on given date
                 -c --commodity-style=S    Override a commodity's display style.
                                           Eg: -c '.' or -c '1.000,00 EUR'
-                   --color=YN --colour    Use ANSI color codes in text output? Can be
-                                          'y'/'yes'/'always', 'n'/'no'/'never' or 'auto'.
                    --pretty[=YN]          Use box-drawing characters in text output? Can be
                                           'y'/'yes' or 'n'/'no'.
                                           If YN is specified, the equals is required.
@@ -180,6 +180,8 @@
                    --man                  show the manual with man
                    --version              show version information
                    --debug=[1-9]          show this much debug output (default: 1)
+                   --pager=YN             use a pager when needed ? y/yes (default) or n/no
+                   --color=YNA --colour   use ANSI color ? y/yes, n/no, or auto (default)
 
        hledger-web   shows  accounts  with  zero  balances  by  default  (like
        hledger-ui, and unlike hledger).  Using the -E/--empty  flag  will  re-
@@ -192,6 +194,10 @@
        query, which although not shown in the UI, will restrict the data shown
        (in addition to any search query entered in the UI).
 
+       If  you use the bash shell, you can auto-complete flags by pressing TAB
+       in the command line.  If this is not working see Install >  Shell  com-
+       pletions.
+
 PERMISSIONS
        By  default,  hledger-web  allows  anyone  who can reach it to view the
        journal and to add new transactions, but not to change existing data.
@@ -449,7 +455,7 @@
 
 BUGS
        We  welcome  bug  reports  in  the  hledger  issue  tracker  (shortcut:
-       http://bugs.hledger.org), or on the #hledger chat or hledger mail  list
+       https://bugs.hledger.org),  or  on  the  hledger  chat  or  mail   list
        (https://hledger.org/support).
 
        Some known issues:
@@ -474,4 +480,4 @@
 SEE ALSO
        hledger(1), hledger-ui(1), hledger-web(1), ledger(1)
 
-hledger-web-1.40                September 2024                  HLEDGER-WEB(1)
+hledger-web-1.41                 October 2024                   HLEDGER-WEB(1)
diff --git a/static/hledger.js b/static/hledger.js
--- a/static/hledger.js
+++ b/static/hledger.js
@@ -163,8 +163,8 @@
 // Set the add-new-row-on-keypress handler on the add form's current last amount field, only.
 // (NB: removes all other keypress handlers from all amount fields).
 function addformLastAmountBindKey() {
-  $('.amount-input').off('keypress');
-  $('.amount-input:last').keypress(addformAddPosting);
+  $('input[name=amount]').off('keypress');
+  $('input[name=amount]:last').keypress(addformAddPosting);
 }
 
 // Pre-fill today's date and focus the description field in the add form.
@@ -186,16 +186,29 @@
 
 // Insert another posting row in the add form.
 function addformAddPosting() {
-  if (!$('#addform').is(':visible')) {
-    return;
-  }
-  // Clone the old last row to make a new last row
-  $('#addform .account-postings').append( $('#addform .account-group:last').clone().addClass('added-row') );
-  // renumber and clear the new last account and amount fields
-  var n = $('#addform .account-group').length;
-  $('.account-input:last').prop('placeholder', 'Account '+n).val('');
-  $('.amount-input:last').prop('placeholder','Amount '+n).val('');  // XXX Enable typehead on dynamically created inputs
-  // and move the keypress handler to the new last amount field
+  if (!$('#addform').is(':visible')) { return; }
+
+  // Clone the last row.
+  var newrow = $('#addform .account-group:last').clone().addClass('added-row');
+  var newnum = $('#addform .account-group').length + 1;
+
+  // Clear the new account and amount fields and update their placeholder text.
+  var accountfield = newrow.find('input[name=account]');
+  var amountfield  = newrow.find('input[name=amount]');
+  accountfield.val('').prop('placeholder', 'Account '+newnum);
+  amountfield.val('').prop('placeholder', 'Amount '+newnum);
+
+  // Enable autocomplete in the new account field.
+  // We must first remove these typehead helper elements cloned from the old row,
+  // or it will recursively add helper elements for those, causing confusion (#2215).
+  newrow.find('.tt-hint').remove();
+  newrow.find('.tt-input').removeClass('tt-input');
+  accountfield.typeahead({ highlight: true }, { source: globalThis.accountsCompleter.ttAdapter() });
+
+  // Add the new row to the page.
+  $('#addform .account-postings').append(newrow);
+
+  // And move the keypress handler to the new last amount field.
   addformLastAmountBindKey();
 }
 
diff --git a/templates/add-form.hamlet b/templates/add-form.hamlet
--- a/templates/add-form.hamlet
+++ b/templates/add-form.hamlet
@@ -1,23 +1,28 @@
 <script>
+
   jQuery(document).ready(function() {
-    descriptionsSuggester = new Bloodhound({
+
+    // Set up global completers which can be attached to appropriate inputs when needed
+
+    globalThis.descriptionsCompleter = new Bloodhound({
       local:#{toBloodhoundJson (toList descriptions)},
       limit:100,
       datumTokenizer: function(d) { return [d.value]; },
       queryTokenizer: function(q) { return [q]; }
     });
-    descriptionsSuggester.initialize();
+    globalThis.descriptionsCompleter.initialize();
 
-    accountsSuggester = new Bloodhound({
+    globalThis.accountsCompleter = new Bloodhound({
       local:#{toBloodhoundJson (journalAccountNamesDeclaredOrImplied j)},
       limit:100,
       datumTokenizer: function(d) { return [d.value]; },
       queryTokenizer: function(q) { return [q]; }
     });
-    accountsSuggester.initialize();
+    globalThis.accountsCompleter.initialize();
 
-    jQuery('input[name=description]').typeahead({ highlight: true }, { source: descriptionsSuggester.ttAdapter() });
-    jQuery('input[name=account]').typeahead({ highlight: true }, { source: accountsSuggester.ttAdapter() });
+    // Attach the completers to the initial form inputs.
+    jQuery('input[name=description]').typeahead({ highlight: true }, { source: globalThis.descriptionsCompleter.ttAdapter() });
+    jQuery('input[name=account]'    ).typeahead({ highlight: true }, { source: globalThis.accountsCompleter.ttAdapter() });
   });
 
   const utf8textdecoder = new TextDecoder();
