An account has type asset. Why does strict mode disagree with it?

If my journal is:

commodity "" 

account a ; type:A
account b 
account c 

2025-09-17 start
    a              1 
	  b              2
    c         

And then run hledger check -s, it yields this error:

hledger.exe: Error: C:\Users\ganuo/test.j:8:
  | 2025-09-17 start
8 |     a               1
  |     ^
  |     b               2
  |     c              -3

Strict account checking is enabled, and
account "a" has not been declared.
Consider adding an account directive. Examples:

account a

But if the account isn't assigned any type, then it passes. Why is that?

You need 2+ spaces to end an account name (because space and semicolon are allowed in account names. Run `hledger accounts -d` to see what happened.) Sorry, annoying I know.

https://hledger.org/faq.html#why-does-this-journal-fail-strict-account-checking-even-though-i-declared-all-accounts-

1 Like

I see. Perhaps having a hint should help?

How would it work exactly ? Without bothering people relying on this feature in their account names ? Perhaps we could discuss in chat ?

(I expanded this topic in docs, at https://hledger.org/dev/hledger.html#two-space-delimiter)

1 Like