thi-ng / umbrella

⛱ Broadly scoped ecosystem & mono-repository of 199 TypeScript projects (and ~180 examples) for general purpose, functional, data driven development
https://thi.ng
Apache License 2.0
3.38k stars 150 forks source link

[errors] `UMBRELLA_ASSERTS` breaking skypack CDN imports #361

Closed stwind closed 1 year ago

stwind commented 1 year ago

The new UMBRELLA_ASSERTS environment variable seems not recognized by skypack's build system, thus breaking its imports. Here is a demo, using <script type="module" src="https://cdn.skypack.dev/@thi.ng/errors"></script> results in

TypeError: undefined is not an object (evaluating 'process.env.UMBRELLA_ASSERTS')

looks like process is defined but not process.env, maybe adding another check for that or there is some way to work around?

postspectacular commented 1 year ago

Ohh.. thank you @stwind! This env var is actually not new and the issue is a regression of a recent update from a month ago when I got rid of the obsolete snowpack (not skypack!) env var logic: 781470d92b0a9aa6fe4a93935bd346a7fd4fc4fc

I've been testing this new logic with Vite, however should also have checked skypack, which seems to transpile this module to a different result & injects stuff not present in the original code... I will push an update in a minute, but we can only check if that works after the next release. Btw. the same issue also applies to @thi.ng/expose: 9a98c3e3b4ce93b765d1ca18bc16b70bc53eaa20

postspectacular commented 1 year ago

So I just pushed v2.2.3 (changelog) and it seems to have fixed the issue. Once I hear back from you with confirmation I will apply same fix for the thi.ng/expose package... 👍

stwind commented 1 year ago

Thanks @postspectacular , it works fine now, also check some other dependents like @thi.ng/vectors and they are working. Yeah I think you can push the same to @thi.ng/expose

postspectacular commented 1 year ago

Amazing & will do! Thank you again, as always!

postspectacular commented 1 year ago

Okay, fixed & released the expose pkg too now!