harttle / liquidjs

A simple, expressive, safe and Shopify compatible template engine in pure JavaScript.
https://liquidjs.com
MIT License
1.52k stars 238 forks source link

v9.36.1 breaks on Deno #497

Closed oscarotero closed 2 years ago

oscarotero commented 2 years ago

Hi. I'm importing this library to use on Deno using esm.sh CDN:

import * as liquid from "https://esm.sh/liquidjs@9.36.0";

It works fine until the latest version, showing the following error:

error: Uncaught TypeError: The URL must be of scheme file
    throw new ERR_INVALID_URL_SCHEME("file");
          ^
    at fileURLToPath (https://deno.land/std@0.135.0/node/url.ts:1198:11)
    at createRequire (https://deno.land/std@0.135.0/node/module.ts:685:20)
    at https://cdn.esm.sh/v77/liquidjs@9.36.1/deno/liquidjs.js:2:6177

I suspect this is due this change: https://github.com/harttle/liquidjs/commit/eec381ec72db3858452799b7a3264e240be3044d that breaks the automatic conversion to Deno by esm.sh

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 9.36.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

harttle commented 2 years ago

I cannot find a way to run esm.sh against local file so didn't add any test case for this. Maybe we need officially build a deno bundle to test deno in the future. Still need to see how many people are using LiquidJS in deno.

oscarotero commented 2 years ago

Hi. Thanks, it works fine now. If you want to provide support for Deno, I recommend to use https://github.com/denoland/dnt. It's the official way to develop a library using Deno (so you have built-in TypeScript support, testing, etc) and publish the package to Deno and npm.