We're updating the issue view to help you get more done. 

Node packages with browser entry don't work with Closure

Description

Closure doesn't yet support package.json browser field: https://github.com/google/closure-compiler/issues/2433

However, our, module_deps.js / brower-resolve, and use this field.

One package that has problems is https://github.com/PaulLeCam/react-leaflet which depends on https://github.com/BerkeleyTrue/warning which uses browser entry.
index-node-modules-dir reuturns a list of all JS files in node_modules, this includes both warning/warning.js and warning/browser.js. index-node-modules only includes warning/browser.js. Because Closure doesn't understand package.json browser field, it can't resolve the warning require when processing React-leaflet: https://github.com/PaulLeCam/react-leaflet/blob/master/lib/Pane.js#L47

1 2 3 4 (cljs.closure/index-node-modules-dir) ;; => {:file "/home/juho/Source/x/y/node_modules/warning/warning.js", :module-type :es6, :provides ["warning/warning.js" "warning/warning" "warning"]} {:file "/home/juho/Source/x/y/node_modules/warning/browser.js", :module-type :es6, :provides ["warning/browser.js" "warning/browser"]}
1 2 3 (cljs.closure/index-node-modules ["react-leaflet"]) ;; => {:file "/home/juho/Source/x/y/node_modules/warning/browser.js", :module-type :es6, :provides ["warning" "warning/browser.js" "warning/browser"]}

Environment

None

Status

Assignee

Unassigned

Reporter

Juho Teperi

Labels

Approval

Vetted

Patch

None

Fix versions

Affects versions

1.9.854

Priority

Major