eleventy: LiquidJS import broken as of latest version, 10.16.5

Edit: I created a PR here: #3426

Operating system

Fedora Linux 40

Eleventy

canary

Describe the bug

Hello It’s probably me, but i can’t get even the most simple use case to work:

➜ node -v
v18.20.4
➜ echo '# Heading' > index.md
➜ npx @11ty/eleventy@canary --serve
[11ty] Eleventy Fatal Error (CLI):
[11ty] The requested module 'liquidjs' does not provide an export named 'default' (via SyntaxError)
[11ty] 
[11ty] Original error stack trace: file:///home/lexoyo/.npm/_npx/82761691191ced73/node_modules/@11ty/eleventy/src/Engines/Liquid.js:2
[11ty] import liquidLib, { Tokenizer, evalToken } from "liquidjs";
[11ty]        ^^^^^^^^^
[11ty] SyntaxError: The requested module 'liquidjs' does not provide an export named 'default'
[11ty]     at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
[11ty]     at async ModuleJob.run (node:internal/modules/esm/module_job:191:5)
[11ty]     at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
[11ty]     at async importModuleDynamicallyWrapper (node:internal/vm/module:432:15)
[11ty]     at async /home/lexoyo/.npm/_npx/82761691191ced73/node_modules/@11ty/eleventy/cmd.cjs:57:24

This is supposed to work right? Or did I miss something in v3?

Reproduction steps

follow the getting started guide but with canary

  1. echo ‘# Heading’ > index.md
  2. npx @11ty/eleventy@canary --serve

Result

Error with the import of liquidjs module

Expected behavior

build the site in _site

Notes

  1. I tried to run the tests of 11ty source / repo and it fails the same
  2. eleventy v2 works fine

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 16 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Guys, please try latest v10.16.7, which reverted some changes on 10.16.5.

This issue will affect folks that freshly installed Eleventy v3 when liquidjs@10.16.5 was the latest version but will not affect folks installing Eleventy with current v3 releases moving forward.

v3.0.0-beta.2 and v3.0.0-alpha.19 will ship with "liquidjs": "^10.16.7"

Some package-lock.json discussion at #3100—please chime in @lexoyo!

Sorry to hear that Alex. CloudCannon builds are also broken for the same reason. Netlify does respect overrides and I was able to get the project I am working on building there with it.

Silex looks very cool.

Nice workaround, thx!

@lexoyo thanks for all this work, would you mind re-titling this issue to something more relevant like, for example, “LiquidJS import broken as of latest version, 10.16.5”?

Done

It is linked to the latest version of liquidjs package

-        "liquidjs": "10.16.4",
+        "liquidjs": "10.16.5",

the 10.16.4 works fine

this is because of a bold import in /src/Engines/Liquid.js

-import liquidLib, { Tokenizer, evalToken } from "liquidjs";
+import { Tokenizer, TokenKind, evalToken, Liquid as LiquidJs } from "liquidjs";

this is when it went wrong but i don’t understand how the tests didn’t fail 😕

I did a PR with the proper (same as in liquidjs’s docs i mean): #3425