liquid.node.esm.js breaks in module context
wyozi opened this issue · 2 comments
wyozi commented
Hi, I'm trying to use liquidjs in a esm project. However, it fails in runtime with this error: ReferenceError: require is not defined in ES module scope, you can use import instead
The culprit seems to be this line in the built liquid.node.esm.js dist: const requireResolve = require.resolve;
(that's line 1479 in v.10.16.4)
Using node version 21
harttle commented
Please try v10.16.5, added some checks for the demo cases including esm scenario.
More complex scenarios like in-browser rendering is not checked in real browsers yet. Will do latter, but not seeing too many ppl come across issues in browsers.
wyozi commented
Thanks, seems to work now