-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax error compiling with figwheel #58
Comments
+1 |
I'm running into the same problem with Versions:
Error:
|
I am also facing this exact issue. |
I have found a solution to the problem. The problem was caused by :error-while-loading camel-snake-kebab.core
#error {
:cause "camel-snake-kebab.internals.alter-name"
:via
[{:type clojure.lang.Compiler$CompilerException
:message "Syntax error compiling at (camel_snake_kebab/core.cljc:49:1)."
:data #:clojure.error{:phase :compile-syntax-check, :line 49, :column 1, :source "camel_snake_kebab/core.cljc"}
:at [clojure.lang.Compiler analyzeSeq "Compiler.java" 7115]}
{:type java.lang.ClassNotFoundException
:message "camel-snake-kebab.internals.alter-name"
:at [java.net.URLClassLoader findClass "URLClassLoader.java" 435]}]
... Fix for this is to alter var Below is the function I am using now. I have tested this and it works great. (ns user
(:require
[clojure.java.classpath :as cp]
[clojure.string :as str])
(:use
[dev]
[dev-extras :exclude [go]])
(:import (java.io File)))
(defn go
([]
(go "target/dev"))
([figwheel-output-directory]
(let [directories-to-reload (into []
(filter #(not (str/includes? (.getPath ^File %) figwheel-output-directory)))
(cp/classpath))]
(alter-var-root #'clojure.tools.namespace.repl/refresh-dirs (constantly directories-to-reload))
(dev-extras/go)))) Now, after calling |
When using
camel-snake-kebab
in clojurescript, running fighweel and tests at the same time i get this error:Error refreshing environment: Syntax error compiling at (camel_snake_kebab/core.cljc:16:1).
The line specified is the first line where a conversion is defined with the
defconversion
macro fromcamel-snake-kebab.macros
:I don't know the exact reason for why this fails, but it has something to do with the conversion functions being defined with a macro. Redefining the conversion functions with
defn
and not requiringcamel-snake-kebab-core
solves the issue for me:All of these are type preserving, but I don't see the need for defining explicit type converting functions like
->kebab-case-keyword
when you can just do(comp keyword ->kebab-case)
?As far as I can tell this works the same as when using
defconversion
, I might be missing something here though so please correct me if I'm wrong.The text was updated successfully, but these errors were encountered: