This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-13
Channels
- # adventofcode (84)
- # aleph (1)
- # announcements (2)
- # aws (27)
- # beginners (52)
- # braveandtrue (2)
- # calva (440)
- # cider (7)
- # clara (2)
- # cljdoc (26)
- # cljs-dev (70)
- # clojure (131)
- # clojure-berlin (4)
- # clojure-brasil (1)
- # clojure-europe (2)
- # clojure-greece (4)
- # clojure-hamburg (1)
- # clojure-italy (4)
- # clojure-losangeles (6)
- # clojure-nl (14)
- # clojure-spec (7)
- # clojure-uk (25)
- # clojurescript (26)
- # component (2)
- # cursive (13)
- # datomic (60)
- # dirac (59)
- # docker (1)
- # figwheel (1)
- # figwheel-main (2)
- # fulcro (12)
- # graphql (5)
- # juxt (33)
- # leiningen (19)
- # nrepl (1)
- # off-topic (37)
- # protorepl (2)
- # re-frame (18)
- # reagent (46)
- # remote-jobs (1)
- # ring-swagger (1)
- # shadow-cljs (88)
- # sql (10)
- # tools-deps (64)
- # vim (24)
Error handling response - class java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.String
<eval>:12
:(function (){var writer__7270__auto__ = (new java.io.StringWriter());
^
ReferenceError: java is not defined
at <eval>:12:42
at <eval>:16:3
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at runInThisContext (vm.js:139:38)
at global.SHADOW_NODE_EVAL ([stdin]:75:30)
at
:thinking_face:@idiomancy that looks like it is trying to eval clojure code? that certainly is not valid CLJS 😉
yeah, thats what I mean. This seems to be an error printing an exception. This is very strange.
Hey guys! Just encountered something strange with :infer-externs :auto
(shadow 2.7.9):
Given this code:
(ns foo.bar)
(defprotocol JustUsedAsATag)
(defrecord SomeRecord [field]
JustUsedAsATag)
I get this warning:
Cannot infer target type in expression (. (. SomeRecord -prototype) -foo$bar$JustUsedAsATag$)
It happens only when the protocol do not declare any method (empty protocol). Is this related to shadow? Should I open an issue?@ggaillard interesting. never seen that before. it did not happen previously?
It's the first time I have a use case for an empty protocol, so I never tried before. Anyway I never saw this warning while compiling other libs thought
Sorry I don't know since it's the first time I'm using an empty protocol.
Has anyone tried nw.js with shadow-cljs ?
@thheller Can you point me to a sample link on github?
I mean electron.
slightly old but should still work https://github.com/shadow-cljs/examples/tree/master/electron
WoW this is what i wanted, thanks @thheller
Good morning! Is clj-refactor supported with the CIDER in shadow? Manually adding the dependencies don't seem to help. Here's what I currently have:
;; :dependencies
[com.billpiel/sayid "0.0.17"]
[refactor-nrepl "2.4.0"]
[cider/cider-nrepl "0.19.0-SNAPSHOT"]
;; Output after cider-connect
WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
CIDER is working fine, I'm just missing the refactoring features. (Haven't tried sayid, but I doubt it works on cljs)@thheller: I still fail with building a working :release
build. I get this stack trace (hopefully I haven't trunkated it too early again):
TypeError: Cannot read property 'core' of undefined
extensionHostProcess.js:344
at Object.<anonymous> (/Users/petery/Projects/calva-lib/packages/lib/cljs.core.js:8:280)
at Object.<anonymous> (/Users/petery/Projects/calva-lib/packages/lib/cljs.core.js:2044:3)
at Module.t._initNodeRequire.r._compile (/Applications/Visual Studio )
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Function.t._load (/Applications/Visual Studio )
at Function.t.getExtensionPathIndex.then.s._load (/Applications/Visual Studio )
at Function.t.getExtensionPathIndex.then.r._load (/Applications/Visual Studio )
at Module.require (module.js:586:17)
at n (/Applications/Visual Studio )
at Object.<anonymous> (/Users/petery/Projects/calva-lib/packages/lib/calva.fmt.formatter.js:1:232)
at Object.<anonymous> (/Users/petery/Projects/calva-lib/packages/lib/calva.fmt.formatter.js:37:3)
at Module.t._initNodeRequire.r._compile (/Applications/Visual Studio )
At /lib/calva.fmt.formatter.js:1:232
it is requiring calva.js_utils.js
which is built from this small cljs file: (ns calva.js-utils)
(defn ^:export jsify [o]
(clj->js o))
(defn ^:export cljify [o]
(js->clj o :keywordize-keys true))
what do the first few lines of /Users/petery/Projects/calva-lib/packages/lib/cljs.core.js
look like?
First two:
var window=global;var $CLJS=require("./cljs_env");require("./goog.math.long.js");require("./goog.math.integer.js");require("./goog.string.string.js");require("./goog.object.object.js");require("./goog.array.array.js");require("./goog.uri.uri.js");require("./goog.string.stringbuffer.js");
var cljs$cst$keyword$ns,cljs$cst$symbol$root,cljs$cst$symbol$default_DASH_dispatch_DASH_val,cljs$cst$symbol$mseq,cljs$cst$symbol$defrecord_STAR_,cljs$cst$keyword$val,cljs$cst$symbol$_meta,cljs$cst$symbol$js_STAR_,cljs$cst$symbol$__hash,cljs$cst$symbol$ns_STAR_,cljs$cst$symbol$ascending_QMARK_,cljs$cst$symbol$fqn,cljs$cst$symbol$update_DASH_count,cljs$cst$symbol$off,cljs$cst$symbol$cnt,cljs$cst$keyword$status,cljs$cst$keyword$descendants,cljs$cst$symbol$nil_DASH_val,cljs$cst$symbol$dispatch_DASH_fn,
Still get the "no project found" warning, but things are apparently working! Thanks!
How do i reference a javascript file from CLJS? i already inserted the folder in the source path
@thheller, do you recommend using this when working with JSX or there is another way?
Do you know what is the main cause of this error? :
[:app] Build failure:
The required JS dependency "Components/list" is not available, it was required by "dbiz_health/common/views.cljs".
Searched in:/Users/pimentel/Projetos/dbiz-health/node_modules
You probably need to run:
npm install Components/list
when i read them i got the belief that putting the folder in sources was enough, i think i did not read it more carefully
you need the /
in front otherwise it'll check node_modules as thats the notation for npm
I’m seeing that this example is kinda different from the javascript i generated locally
import React from "react"
const MyComponent = ({ key }) => {
console.log('child props: ', key)
return (
<li key={key}>
Hello JSX!
</li>
)
}
const MyDefaultComponent = ({ children }) =>
<div>
<h1>Hello JSX!</h1>
<ul>
{children}
</ul>
</div>
export { MyComponent }
export default MyDefaultComponent
Error:
MyComponent.js:7 Uncaught TypeError: Cannot read property 'createElement' of undefined
at MyComponent (MyComponent.js:7)
at beginWork (react-dom.development.js:14564)
at performUnitOfWork (react-dom.development.js:17821)
at workLoop (react-dom.development.js:17861)
at HTMLUnknownElement.callCallback (react-dom.development.js:150)
at Object.invokeGuardedCallbackImpl (react-dom.development.js:200)
at invokeGuardedCallback (react-dom.development.js:257)
at replayUnitOfWork (react-dom.development.js:17108)
at renderRoot (react-dom.development.js:17980)
at performWorkOnRoot (react-dom.development.js:18838)
generated es2016:
import React from "react";
var MyComponent = function MyComponent(_ref) {
var key = _ref.key;
console.log('child props: ', key);
return React.createElement(
"li",
{ key: key },
"Hello JSX!"
);
};
var MyDefaultComponent = function MyDefaultComponent(_ref2) {
var children = _ref2.children;
return React.createElement(
"div",
null,
React.createElement(
"h1",
null,
"Hello JSX!"
),
React.createElement(
"ul",
null,
children
)
);
};
export { MyComponent };
export default MyDefaultComponent;
`