Skip to content

Error "Can't find variable: glittershark" after reloading the app #10

@CrowsVeldt

Description

@CrowsVeldt

Hey. I recently started learning how to make cljs/rn apps, and this week started experimenting with core-async-storage. I didn't have any problems with it until the last couple of days. Now I'm testing a function using get-item, and the first time I try it it works fine, but after making changes and reloading the app it doesn't work.

At first I didn't even get an error message, but after doing some println debugging I got the error Can't find variable: glittershark
on the testing device, and

eval code
eval@[native code]
figwheel$client$utils$eval_helper
#object[ReferenceError ReferenceError: Can't find variable: glittershark]

in the repl.

So far the only way I've found to deal with it is re-starting the repl.

Any idea what might be going wrong, or what I can do about it?
I'm still new at this so let me know if there's some information I left out that could be useful please let me know!

Using Emacs with cider/lein/figwheel, and expo-cljs-template

  • In project.clj:
:dependencies [[org.clojure/clojure "1.9.0"]
                 [org.clojure/clojurescript "1.10.238"]
                 [binaryage/oops "0.5.8"]
                 [reagent "0.7.0" :exclusions [cljsjs/react 
                                                            cljsjs/react-dom 
                                                            cljsjs/react-dom-server 
                                                            cljsjs/create-react-class]]
                 [re-frame "0.9.3"]
                 [react-native-externs "0.1.0"]
                 [org.clojure/core.async "0.4.474"]
                 [cljs-http "0.1.45"]
                 VVVVV
                 [core-async-storage "0.3.1"]]
                  ^^^^^
  :plugins [[cider/cider-nrepl "0.18.0-SNAPSHOT"]
            [lein-cljsbuild "1.1.4"]
            [lein-figwheel "0.5.14"]]

  • In ns requires:
(ns app.storage
  (:require [app.db :refer [app-db]]
            [app.network :refer [update-comic-list!]]
            [app.react-requires :refer [show-toast]]
            [cljs.core.async :refer [<! >! chan]]
            vvvvvv
            [glittershark.core-async-storage :refer [get-item
                                                     set-item
                                                     clear]]
            ^^^^^
            [re-frame.core :refer [dispatch
                                   subscribe]])
  (:require-macros [cljs.core.async.macros :refer [go]]))

  • Code example:
    (go (js/alert (apply str (<! (get-item :comic-data)))))

edit: Added all dependencies from project.clj in case they are relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions