This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-22
Channels
- # aws (1)
- # bangalore-clj (3)
- # beginners (103)
- # boot (15)
- # cider (29)
- # cljs-dev (17)
- # cljsrn (43)
- # clojure (156)
- # clojure-gamedev (2)
- # clojure-italy (11)
- # clojure-spec (55)
- # clojure-uk (4)
- # clojurescript (76)
- # data-science (2)
- # datomic (7)
- # defnpodcast (2)
- # emacs (4)
- # leiningen (2)
- # luminus (3)
- # off-topic (11)
- # parinfer (3)
- # pedestal (1)
- # quil (1)
- # re-frame (3)
- # reagent (2)
- # ring-swagger (1)
- # timbre (3)
- # unrepl (10)
- # untangled (1)
- # vim (3)
- # yada (1)
I am trying out clojurescript master to test out the npm deps. Because we need to interface with certain external libraries for which we currently have a webpack build which we add to our clojurescript build which we would really like to get rid of. We have the following in npm-deps:
{"@atlaskit/navigation" "16.0.0"
"@atlaskit/util-shared-styles" "^2.1.0"
"prop-types" "^15.5.10"
"react" "^15.4.2"
"react-dom" "^15.4.2"
"styled-components" "2.1.1"}
I am getting the following error while trying to require @atlaskit/navigation
:
Uncaught Error: Undefined nameToPath for module$home$mitchel$Development$atlas_crm_next$node_modules$core_js$library$modules$es6_object_define_property
Any idea what could cause this? I could also make repository with a minimal reproduction if that helps
I created a small project to reproduce the error it seems the error comes from the styled-components
library so this one tries to use that first and fails: https://github.com/mitchelkuijpers/cljs-atlaskit-node-modules
@mitchelkuijpers if you look in your out
directory, my guess is that module can’t be processed by Closure
I tried this in master btw
so you’ll see something weird under out/node_modules/core_js/library/modules/es6_object_define_property
or something
Is see some very weird filenames under out/node_modules/core_js/library/modules/
_add-to-unscopables.js _enum-bug-keys.js es6.object.set-prototype-of.js _hide.js _keyof.js _object-gops.js _shared.js web.dom.iterable.js
_a-function.js _enum-keys.js es6.object.to-string.js _html.js _library.js _object-gpo.js _shared-key.js _wks-define.js
_an-object.js es6.array.iterator.js es6.string.iterator.js _ie8-dom-define.js _meta.js _object-keys-internal.js _string-at.js _wks-ext.js
_array-includes.js es6.object.assign.js es6.symbol.js _iobject.js _object-assign.js _object-keys.js _to-index.js _wks.js
_cof.js es6.object.create.js es7.symbol.async-iterator.js _is-array.js _object-create.js _object-pie.js _to-integer.js
_core.js es6.object.define-properties.js es7.symbol.observable.js _is-object.js _object-dp.js _object-sap.js _to-iobject.js
_ctx.js es6.object.define-property.js _export.js _iterators.js _object-dps.js _property-desc.js _to-length.js
_defined.js es6.object.freeze.js _fails.js _iter-create.js _object-gopd.js _redefine.js _to-object.js
_descriptors.js es6.object.get-prototype-of.js _global.js _iter-define.js _object-gopn-ext.js _set-proto.js _to-primitive.js
_dom-create.js es6.object.keys.js _has.js _iter-step.js _object-gopn.js _set-to-string-tag.js _uid.js
it seems to me the file is missing, but it created one with dots...:
'use strict';goog.require("module$home$mitchel$Development$atlas_crm_next$node_modules$core_js$library$modules$_object_dp");goog.require("module$home$mitchel$Development$atlas_crm_next$node_modules$core_js$library$modules$_descriptors");goog.require("module$home$mitchel$Development$atlas_crm_next$node_modules$core_js$library$modules$_export");var $export=module$home$mitchel$Development$atlas_crm_next$node_modules$core_js$library$modules$_export;module$home$mitchel$Development$atlas_crm_next$node_modules$core_js$library$modules$_export(module$home$mitchel$Development$atlas_crm_next$node_modules$core_js$library$modules$_export.S+
module$home$mitchel$Development$atlas_crm_next$node_modules$core_js$library$modules$_export.F*!module$home$mitchel$Development$atlas_crm_next$node_modules$core_js$library$modules$_descriptors,"Object",{defineProperty:module$home$mitchel$Development$atlas_crm_next$node_modules$core_js$library$modules$_object_dp.f})
This might be stuff for which you need babel
But not sure how to apply those to stuff you want to require from node_modules
Just a thought: It would be nice if the errors are clearly stating when a library can’t be processed. Otherwise people are gonna blame it on themselves and think they’re doing it wrong / that things are somehow not working for them or brittle.
Not sure how easy that would be to diagnose though.
@mitchelkuijpers here’s the problem: https://github.com/zloirock/core-js/blob/master/library/modules/es6.object.define-property.js
exports are dynamic, Closure can’t figure out what that module exports
this kind of dynamic stuff is hardly ever going to work with Closure
Hmm so I guess it will be very hard to use this stuff without a webpack build 😞
thank you @anmonteiro then I'll stop trying