eleventy icon indicating copy to clipboard operation
eleventy copied to clipboard

"Unhandled rejection in promise" error when saving changes to Markdown files

Open ghost opened this issue 1 year ago • 2 comments

Here's my MWE repo to replicate/validate the error: https://github.com/jamesbont11tyrepo/11ty-MWE

To reproduce the error, run npm start for the repo and then simply:

  1. Open one of the Markdown files.
  2. Make changes to the file.
  3. Save the changes.

The terminal should show error text like so:

[11ty] Unhandled rejection in promise: (more in DEBUG output)
[11ty] Tried to use templateContent too early on ./file/path/with/markdown/file.md (via TemplateContentPrematureUseError)
[11ty] 
[11ty] Original error stack trace: TemplateContentPrematureUseError: Tried to use templateContent too early on ./file/path/with/markdown/file.md

The Eleventy Discord group has tried helping me figure out what's causing the error, but we're stumped (discussion topic here: https://discord.com/channels/741017160297611315/1182433386111971338). Sometimes we'd find the error happens on some Markdown files for some of us, but not for other people, so if you don't get the error on one Markdown file, try the other. I hope we can find the cause of this error and a solution!

ghost avatar Jan 03 '24 17:01 ghost

Just noticed this other bug has the same issue I'm having, but they're on the 3.0 alphas, whereas I'm on the stable 2.0 version.

https://github.com/11ty/eleventy/issues/3136

ghost avatar Jan 12 '24 02:01 ghost

This one started happening after I upgraded to 3.0.0-alpha.6, when I save my CSS I occasionally get the error.

huphtur avatar Apr 13 '24 00:04 huphtur