Uploaded image for project: 'ClojureScript'
  1. CLJS-2393

process.env preload is added after all existing preloads

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects versions: 1.9.908
    • Fix versions: None
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: