Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

When there're other preloads and the check for process-shim returns true, process.env is added to the end of the vector of all preloads.
That causes problems when one of the previous preloads requires something that checks process.env during loading.

E.g. I have a Reagent application with :npm-deps set to React and a few other libraries. And I have a preload exactly like this one: https://github.com/flexsurfer/re-frisk/blob/master/src/re_frisk/preload.cljs
The issue is that re-frisk.core requires Reagent, which requires React, which checks process.env - all before process.env was actually created.

I think that process.env should go before all existing preloads.

2 Answers

0 votes

Comment made by: hpnm

Workaround is to manually add process.env to the first of :preloads vector

0 votes
Reference: https://clojure.atlassian.net/browse/CLJS-2393 (reported by alex+import)