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
- echo ‘# Heading’ > index.md
- npx @11ty/eleventy@canary --serve
Result
Error with the import of liquidjs module
Expected behavior
build the site in _site
Notes
- I tried to run the tests of 11ty source / repo and it fails the same
- 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
- Fix build failure and update other deps (#11090) This PR works around the error caused by https://github.com/11ty/eleventy/issues/3425 by pinning the `liquidjs` dependency to an earlier version. — committed to flutter/website by parlough 2 years ago
- workaround https://github.com/11ty/eleventy/issues/3425 — committed to silexlabs/Silex by lexoyo 2 years ago
- Fix the breakage introduced by the new release of LiquidJS See https://github.com/11ty/eleventy/issues/3425 — committed to h-tex/eleventy-plugin-citations by DmitrySharabin 2 years ago
- fix #3425 import of Liquid.js (#3426) — committed to 11ty/eleventy by zachleat 2 years ago
- chore(deps): override liquidjs to 10.16.4 until 11ty/eleventy#3425 is fixed — committed to noelforte/eleventy-plugin-vento by noelforte 2 years ago
- revert workaround https://github.com/11ty/eleventy/issues/3425 since the issue is fixed in 11ty — committed to silexlabs/Silex by lexoyo 2 years ago
- chore(deps): override liquidjs to 10.16.4 until 11ty/eleventy#3425 is fixed — committed to noelforte/eleventy-plugin-vento by noelforte 2 years ago
- chore(deps): override liquidjs to 10.16.4 until 11ty/eleventy#3425 is fixed — committed to noelforte/eleventy-plugin-vento by noelforte 2 years ago
- chore(deps): override liquidjs to 10.16.4 until 11ty/eleventy#3425 is fixed — committed to noelforte/eleventy-plugin-vento by noelforte 2 years ago
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.5was 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
overridesand I was able to get the project I am working on building there with it.Silex looks very cool.
Nice workaround, thx!
Done
It is linked to the latest version of liquidjs package
the
10.16.4works finethis is because of a bold import in
/src/Engines/Liquid.jsthis 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