Fork me on GitHub
#shadow-cljs
<
2020-04-16
>
juhoteperi10:04:30

Any ideas what could cause parse errors with Node modules? In this case I'm having problems with Openlayers 6. I also had to remove .shadow-cljs/builds to even get Shadow-cljs to use the new sources.

juhoteperi10:04:51

------ WARNING #1 -  -----------------------------------------------------------
 Resource: node_modules/ol/Feature.js:107:20
 Parse error. name not recognized due to syntax error.
--------------------------------------------------------------------------------
------ WARNING #2 -  -----------------------------------------------------------
 Resource: node_modules/ol/layer/BaseVector.js:106:20
 Parse error. name not recognized due to syntax error.
--------------------------------------------------------------------------------
------ WARNING #3 -  -----------------------------------------------------------
 Resource: node_modules/ol/layer/Layer.js:131:20
 Parse error. name not recognized due to syntax error.
--------------------------------------------------------------------------------
------ WARNING #4 -  -----------------------------------------------------------
 Resource: node_modules/ol/renderer/Layer.js:52:20
 Parse error. name not recognized due to syntax error.
--------------------------------------------------------------------------------
------ WARNING #5 -  -----------------------------------------------------------
 Resource: node_modules/ol/renderer/canvas/Layer.js:57:20
 Parse error. name not recognized due to syntax error.
--------------------------------------------------------------------------------
------ WARNING #6 -  -----------------------------------------------------------
 Resource: node_modules/ol/renderer/webgl/Layer.js:87:20
 Parse error. name not recognized due to syntax error.
--------------------------------------------------------------------------------
------ WARNING #7 -  -----------------------------------------------------------
 Resource: node_modules/ol/source/Vector.js:89:20
 Parse error. name not recognized due to syntax error.
--------------------------------------------------------------------------------
------ WARNING #8 -  -----------------------------------------------------------
 Resource: node_modules/ol/source/Vector.js:216:20
 Parse error. name not recognized due to syntax error.
--------------------------------------------------------------------------------

thheller11:04:46

I think it doesn't like those typehints

thheller11:04:58

@type {?import("./events.js").EventsKey}

thheller11:04:18

yeah that error is from the jsdoc parser

thheller11:04:31

there was a way to turn this off but can't find it

juhoteperi11:04:10

What is parsing the files? Closure?

thheller12:04:05

hmm weird there doesn't seem to be any option to turn jsdoc parsing off

thheller12:04:12

but there are just warnings so it should still work?

juhoteperi12:04:02

Yeah, I'm having some problems with OL but could be unrelated to these warnings.

thheller12:04:29

they are aware at least ...

thheller12:04:46

guess its a typescript thing

pmooser15:04:02

I'm doing something slightly weird, but I'm wondering if anyone can help me resolve an inference issue. The short version is, I just enabled :infer-externs , and I am getting a warning from anything in my code that implements reagent.ratom.IReactiveAtom, which is just a methodless tag interface. The error looks like: Cannot infer target type in expression (. (. Example -prototype) -reagent$ratom$IReactiveAtom$)

pmooser15:04:11

The deftype in this example is just:

pmooser15:04:20

(deftype Example []
  reagent.ratom.IReactiveAtom)

pmooser15:04:53

Maybe this is a problem with a failure to require reagent.ratom correctly?

pmooser15:04:58

Trying to read up on this now ...

thheller15:04:04

@pmooser try (:require [reagent.ratom :as ratom]) and (deftype Example [] ratom/IReactiveAtom)

pmooser15:04:19

@thheller I tried that with the same result. For now I've just turned off the inference feature, since it seems to work fine without it.

kenny18:04:03

Has anyone seen this with shadow-clj 2.8.95? It appears to be a misalignment between the assertion and the message keys.

thheller19:04:49

@kenny oops, should be fixed in 2.8.96

kenny19:04:41

Yep, thanks!

👍 4
Seledrex21:04:01

Hello, I am trying to configure https://github.com/borkdude/clj-kondo to work with my shadow-cljs project. To configure it, I need to get the classpath. Other build tools have commands like lein classpath or clojure -Spath but I could not find something similar for shadow-cljs. Any tips on getting the classpath for a shadow-cljs project?

dpsutton21:04:14

check shadow-cljs --help

dpsutton21:04:33

should be shadow-cljs classpath

Seledrex17:04:29

Oh thanks! That should have been obvious 😅