Fork me on GitHub

Has anyone come across this kind of issue when trying to require an npm package ? The file is valid JS, but I guess it could be using some features that Google Closure doesn't support ?

Build failure:
Failed to inspect file

it was required from

Errors encountered while trying to parse file
  {:line 1, :column 1, :message "The file could not be parsed as JavaScript."}

RuntimeException: Exception parsing ".../node_modules/prettier/index.js" (

David Pham05:06:26

Did you install prettier?

David Pham05:06:03

Maybe reinstall it?

David Pham05:06:27

Or maybe it is not valid JavaScript.


@superstructor please always post the full errors. I can reproduce this and I get a closure compiler error. seems to be something in the file it doesn't like. not sure what.

IllegalArgumentException: Must call rewindTo before calling getSourcePosition for an earlier line (1298797 < 1300077) ( ( ( (


Thanks for following it up @thheller :thumbsup: 🙂 and apologies for cutting the error output short.


no biggy. I know that those kind of errors mean internal closure compiler problems, just easier to guess which one with the full trace 🙂


are you including this in a browser build? the prettier package is pretty node focused so I wouldn't have much faith in it working in the browser


Yeah I was trying it in a browser build but I ended up trying js-beautify for now which appears to work OK. Not a critical feature.


hello, doe's anyone here has an experience with devcards? I've finally made devcards "work" but I get no components rendered on the screen, all I see is the `devcards` title and clojurescript logo.. how do I tell devcards to render those cards I have?


@eliraz.kedmi if you setup a reproducible example I can take a look and see if its a setup issue. otherwise no clue about devcards.


@thheller how can I do that?


is there an online env for clojurescript?


create a github repo with instructions on how to produce the problem


sure I'll do that


Thank you!

Felipe Marques21:06:16

I'm trying to add some custom reader tags to my cljs project. It works as expected by when recompilation is triggered by editing some file, I get the following error:

#copy :inclusion.home/inclusion-card-title
my_app/core.cljs [line 26, col 10] No reader function for tag copy.
Does any one have faced this problem.

Felipe Marques21:06:33

I added the require to my main-ns to gurantee that the tag is registered

Felipe Marques21:06:50

I register the tag like this

(cljs.reader/register-tag-parser! 'copy (fn [kw] (copy kw)))


shadow-cljs does not support custom reader tags in source files and never will, unless someone can give me a really convincing reason. so far noone has.


there is literally no reason to ever use it in source code. absolutely fine and useful for data.


just call (copy :inclusion.home/inclusion-card-title) directly instead of #copy :inclusion.home/inclusion-card-title.


cljs.reader is for reader tags in data parsed by cljs.reader is is not for source code.


eg. (cljs.reader/read-string "#copy :foo") is totally fine and you have total control over that

Felipe Marques22:06:58

humm, I understand. It was a more stylistic choice than regarding any functionality. I'll use the function directly.


FWIW custom reader tags in code are an absolute nightmare for tooling

👀 4

since its impossible to tell what you are doing in the read fn and it occurs during read time ...


macros or regular functions already let you do everything you can possibly want to do, just in a more well defined manner