Description
When pinning the esm.sh server version, it does seem to work as expected for some packages but not for others.
For example:
When requesting https://esm.sh/v117/moment@2.29.4, I am getting the following code which (correctly) "forwards" the v117
version pin :
/* esm.sh - moment@2.29.4 */
export * from "https://esm.sh/v117/moment@2.29.4/es2022/moment.mjs";
export { default } from "https://esm.sh/v117/moment@2.29.4/es2022/moment.mjs";
But when requesting https://esm.sh/v117/preact@10.13.2, I am getting the following code which has (incorrectly) transformed the v117
version pin into stable
:
/* esm.sh - preact@10.13.2 */
export * from "https://esm.sh/stable/preact@10.13.2/es2022/preact.mjs";
As a result, when working with Deno and deno.lock
, when the version pin is transformed to stable, it can lead to unexpected "The source code is invalid, as it does not match the expected hash in the lock file."
errors. These errors happen because Deno caches the content of "https://esm.sh/stable/preact@10.13.2/es2022/preact.mjs", but that content may sometimes change whenever stable
is pointing to a different server version that generates a different content, like what happened this week.