String requires broken after recompile

Description

String requires uses js-module-exists? to check if module needs to loaded: https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer.cljc#L722

It checks the compiler state for :js-module-index.

The first time e.g. react-dom/server is not found.

If using the same compiler state for recompile, the second time the module is already present in compiler-state.

This means that the module is not indexed into foreign-libs: https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L2043

Result is that cljs_deps.js won't have the line for react-dom/sever or No such namespace exception about react-dom$server.

Environment

None

Status

Assignee

David Nolen

Reporter

Juho Teperi

Labels

Approval

Vetted

Patch

None

Fix versions

Affects versions

1.9.854

Priority

Blocker
Configure