Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liquid.node.esm.js breaks in module context #739

Open
wyozi opened this issue Aug 27, 2024 · 1 comment
Open

liquid.node.esm.js breaks in module context #739

wyozi opened this issue Aug 27, 2024 · 1 comment
Labels

Comments

@wyozi
Copy link
Contributor

wyozi commented Aug 27, 2024

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 harttle added the bug label Aug 27, 2024
harttle added a commit that referenced this issue Aug 27, 2024
harttle added a commit that referenced this issue Aug 27, 2024
github-actions bot pushed a commit that referenced this issue Aug 27, 2024
## [10.16.5](v10.16.4...v10.16.5) (2024-08-27)

### Bug Fixes

* ESM bundle for Node.js, [#739](#739) ([ce84cd6](ce84cd6))
@harttle
Copy link
Owner

harttle commented Aug 27, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants