Improved error messaging for non-function Shortcode Definitions (callback.call is not a function
error when compiling Nunjucks files in 3.0.0-alpha)
#3286
Labels
education
error-messaging
release: canary
A release on the canary channel
template-language: nunjucks
Milestone
Operating system
macOS Sonoma 14.0 (23A339)
Eleventy
3.0.0-alpha.10
Describe the bug
Using Eleventy 3.0.0-alpha.10, my website fails to compile Nunjucks files correctly, returning something akin to the following stack trace when debugging is enabled:
The Nunjucks filename and line/column numbers are frequently changing, and just appear to point to whatever file Eleventy is trying to process first.
The
callback.call
referenced in the error message appears to be internal to Eleventy.eleventy/src/Template.js
Lines 471 to 480 in d30b952
As far as I've been able to gather:
{% block %}
s moves where the error is up until a point. It quickly seems to land on a page that lacks one, however.Notably, the content of this branch is identical with the main branch; except for having Eleventy 3.0.0-alpha.10 installed and the configuration & data files converted to ESM format.
All of the actual Nunjucks and Markdown files are untouched, so the issue would seem to lie in either Eleventy 3.0, the included version of Nunjucks, or some aspect of how I've migrated things.
Reproduction steps
Unfortunately due to the mysterious nature of the issue I was unable to create a reduced example.
npm ci
npx @11ty/eleventy
Expected behavior
Ideally, things would compile successfully!
If this is an obscure issue buried somewhere in Eleventy 3.0.0, this could be a barrier to upgrading and migration, which is why I'm raising it before it can (potentially) affect anyone else.
Reproduction URL
https://github.com/querkmachine/beeps.website/tree/eleventy-esm
Screenshots
No response
The text was updated successfully, but these errors were encountered: