vouch-opensource / krell

Simple ClojureScript React Native Tooling
Eclipse Public License 1.0
679 stars 36 forks source link

"TypeError: undefined is not a function" Error when metro loads krell compiled files #131

Closed apostolou closed 3 years ago

apostolou commented 3 years ago

Hello,

with latest version (92115e1f271259e21e67881dd94c2b668e4143d8) I'm having trouble debugging my app (on ios) because I have the following errors when metro tries to load the compiled files.

 ERROR  TypeError: undefined is not a function (near '...(0, _$$_REQUIRE(_dependencyMap[9], "./target/main.js").krellStaleRoot)...')

This error is located at:
    in KrellRoot (at renderApplication.js:47)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:107)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:134)
    in AppContainer (at renderApplication.js:40)
 ERROR  TypeError: undefined is not a function (near '...(0, _$$_REQUIRE(_dependencyMap[9], "./target/main.js").krellStaleRoot)...')

This error is located at:
    in KrellRoot (at renderApplication.js:47)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:107)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:134)
    in AppContainer (at renderApplication.js:40)
 LOG  Connected to Krell REPL Server
 ERROR  Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
    in KrellRoot (at renderApplication.js:47)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:107)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:134)
    in AppContainer (at renderApplication.js:40)

All Krell related steps end with no error (clj -m cljs.main -co "{:deps-cmd \"yarn\"}" --install-deps , clj -m krell.main -co build.edn -c and clj -m krell.main -v -co build.edn -r). The repl is launched and connects to the app, but the error above prevents me from debugging.

My project config is the simplest possible (I've installed from scratch a RN project and followed the instructions in the wiki).

My deps are :

{:deps {io.vouch/krell {:git/url "https://github.com/vouch-opensource/krell"
                        :sha "92115e1f271259e21e67881dd94c2b668e4143d8"}

        io.vouch/reagent-react-native {:git/url "https://github.com/vouch-opensource/reagent-react-native.git"
                                       :sha "0fe1c600c9b81180f76b94ef6004c2f85e7d4aa0"}

        reagent/reagent {:mvn/version "0.10.0"
                         :exclusions [cljsjs/react cljsjs/react-dom]}}}

and my build.edn :

{:main awesome-project.core
 :output-to "target/main.js"
 :output-dir "target"}

Note that everything works fine when I downgrate to Krell @ d0e115309580ca0bdc782e4ca396df66a357d212

Do you have any ideas on how I could make progress on this ? Thanks

swannodette commented 3 years ago

You need to delete index.js it is old.

apostolou commented 3 years ago

thx for the prompt reply ! @ 8c7220bf2f287d5d2af1ce74dc683e0a58041ed5 the issue is corrected ! 👍