This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-31
Channels
- # aws-lambda (4)
- # beginners (152)
- # boot (19)
- # cider (45)
- # cljs-dev (14)
- # clojure (54)
- # clojure-dev (33)
- # clojure-greece (11)
- # clojure-italy (4)
- # clojure-nl (8)
- # clojure-norway (2)
- # clojure-russia (6)
- # clojure-sg (1)
- # clojure-spec (1)
- # clojure-uk (40)
- # clojure-ukraine (5)
- # clojurescript (40)
- # community-development (13)
- # component (8)
- # core-async (3)
- # cursive (25)
- # data-science (11)
- # datomic (13)
- # duct (1)
- # emacs (2)
- # events (16)
- # figwheel (3)
- # fulcro (53)
- # graphql (2)
- # jobs (5)
- # jobs-rus (1)
- # juxt (10)
- # leiningen (4)
- # off-topic (82)
- # other-languages (5)
- # portkey (3)
- # protorepl (13)
- # re-frame (22)
- # reagent (15)
- # ring-swagger (4)
- # shadow-cljs (69)
- # spacemacs (7)
- # specter (16)
- # sql (13)
- # vim (5)
- # yada (2)
Initially I posted in #clojurescript but this may be more relevant here.
I'm trying to use https://github.com/souporserious/react-measure in my project. I specified the dependency using :npm-deps
, and everything is fine up to the moment when I actually try to render the wrapped component:
Uncaught TypeError: _resizeObserverPolyfill2$$module$home$p_himik$dev$git$musicxmlcheck_test$node_modules$react_measure$lib$with_content_rect.default is not a constructor
The check of the objects quickly shows that it's being wrapped by _interopRequireDefault
into {default: ...}
two times:
_resizeObserverPolyfill2$$module$home$p_himik$dev$git$musicxmlcheck_test$node_modules$react_measure$lib$with_content_rect: Object
default:
default: λ[callback]
Has anyone seen anything like it?@p-himik _interopRequireDefault
is from Babel: https://unpkg.com/[email protected]/lib/react-measure.js
default
properties are also from Babel, to help the module being used from ES6 modules
So react-measure
was built with Babel and uploaded to NPM, but resize-observer-polyfill
was not built and was just uploaded?
hmh, maybe Closure doesn't understand that __esModule
check on interop require call
The name mangling for resize-observer-polyfill
didn't create any __esModule
mentions.
resize-observer-polyfill also has built files under dist/
there is ~infinite number of Babel configurations 😕
But in this case how does that even work for the author of react-measure
and all other users of this library?
I don't know, Closure is special case, it might work on browser or node
https://github.com/que-etc/resize-observer-polyfill/blob/master/dist/ResizeObserver.js no ES6 here, the ES6 file is not used by Closure: https://github.com/que-etc/resize-observer-polyfill/blob/master/dist/ResizeObserver.es.js
or hmm... I think it is not used, package.json
has main
, jsnext:main
and module
entries, I'm not certain which Cljs/Closure uses