0

My ClojureScript app is not compiling. It is throwing the error:

1 | (ns mock-file-system.api-service)
Invalid Filename, got mock_file_system/api-service.cljs but expected mock_file_system/api_service.cljs (or .cljc)

The calling namespace:

(ns mock-file-system.views
  (:require
   [re-frame.core :as re-frame]
   [reagent.core :as reagent]
   [mock-file-system.subs :as subs]
   [mock-file-system.node :as node]
   [mock-file-system.api-service :as api]
   ))

The required namespace:

(ns mock-file-system.api-service)

Thanks

Mr. Robot
  • 1,334
  • 6
  • 27
  • 79
  • What's the name of the file containing `mock-file-system.api-service`? The error suggest it's `api-service.cljs` but it should be `api_service.cljs`. – Lee Sep 06 '19 at 16:31
  • Thanks @Lee, it's `api-service.cljs`. I have searched the whole project for `api_service.cljs` but there is nothing. Don't know why it expects `api_service.cljs`. – Mr. Robot Sep 06 '19 at 16:36
  • 1
    So everything works when you rename the file? – Lee Sep 06 '19 at 16:39
  • Yeah :( Looks like you can't use dashes in file names but it converts underscores to dashes in the background. – Mr. Robot Sep 06 '19 at 16:55

1 Answers1

1

Looks like you can't use dashes in file names and it converts underscores to dashes in the background.

Fixed by renaming the file with an underscore.

Mr. Robot
  • 1,334
  • 6
  • 27
  • 79