Skip to content
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

Code reloading fails if you use goog namespace #734

Open
danskarda opened this issue Apr 25, 2019 · 0 comments
Open

Code reloading fails if you use goog namespace #734

danskarda opened this issue Apr 25, 2019 · 0 comments

Comments

@danskarda
Copy link

Example code:

(ns foo.bar
  (:require [goog]))

(js/console.log (goog/Uri. js/window.location.href))

When you change foo.bar namespace, figwheel triggers reloading of foo.bar.

Reload also refreshes goog namespace which has been already patched by figwheel. This reload removes patched function like goog.isProvided_. Consequently goog.provide("foo.bar") fails because original goog.isProvided_ correctly reports that foo.bar is already there. Since then code reloading will not work at all.

Correct behavior should be to call again boostrap-goog-base after goog reload or prevent goog reloading.

This is not huge issue however it can become a nasty surprise. When reloading suddenly stops working, your first reaction is to suspect your latest upgrade of figwheel/cider/nrepl/... rather then change in your namespace dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant