-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
figwheel not serving the app.js #428
Comments
looking at this now |
I traced this to your ring handler stack, your call to |
The :resource-paths and class path are all correct. I have no idea why your call to |
actually think I may have found it |
good to hear, let me know if you want me to do more testing |
man actually this is super funky ... it works and then it doesn't work, think it may be something else in the ring stack because the Figwheel stack works on its own with compile targets in the "target". Maybe reloader is doing it I don't know. |
Yeah there is definitely something in your wrap-middleware that is messing with the state when I remove that . The figwheel-server ring stack hasn't changed at all in this release. |
Hmm, yeah that's pretty weird because it was working consistently with the last release. This is the only middleware being used too. It's just ring-defaults, wrap-exceptions, and wrap-reload. |
@yogthos you bumped up |
Yeah it does look like it's the interplay between them. Would make sense for Figwheel to work with the latest ring-defaults though. :) |
There is nothing fishy going on inside the Figwheel server. https://github.com/bhauman/lein-figwheel/blob/master/sidecar/src/figwheel_sidecar/components/figwheel_server.clj#L156 If you see a safer way to do it let me know. |
I'm still not sure what cause the issue in the new ring-defaults. Unfortunately, I haven't had much time to dig into this yet. I'll let you know if I figure it out though. |
I'm going to look at this again. It occurs to me that I can make this much simpler and get rid of the compojure dep. Which would be a good thing. |
Sweet! :) |
Awesome, I'll push out a new reagent-template with the latest |
I did a bit of testing with the latest and I still see the issue unfortunately. It doesn't appear to be related to middleware, I've tried just using the However, this doesn't happen every time either. Is it possible that there's some race condition in loading the resource paths that's happening. The cljs build config is set as follows here. {:main "{{name}}.dev"
:asset-path "/js/out"
:output-to "target/cljsbuild/public/js/app.js"
:output-dir "target/cljsbuild/public/js/out"
:source-map true
:optimizations :none
:pretty-print true} Not sure if that helps, but I'll keep looking to see if I can narrow this down. |
So you tested against the snapshot? On Thu, Jun 16, 2016 at 12:16 AM, Dmitri Sotnikov [email protected]
|
I haven't deployed this change to clojars yet. |
Ah my bad, I saw a new version show up on Clojars after the issue getting closed and assumed it had the change. Just did a local install for the snapshot and can confirm everything is looking good. Sorry for the noise. ;) |
I ran into a similar issue trying to do the same; although it's not clear that it's exactly the same thing yet, because I'm still seeing it with the current release, which does come after that commit. |
I don't know if this is related, but, I'm seeing:
... despite having configured a ring handler that doesn't show that page. |
Downgrading to 0.5.3-2 does indeed resolve the issue. |
Similar issue - ring handler no longer shows my page, but an index.html is displayed trying to load |
@smogg Can you add the exact versions where the problem started? |
|
|
No issues on |
I used to have a similar problem. The reason was a transitive dependency in my class path with an "index.html" in the jar. Depending on the order of loading, this (wrong) index.html got loaded instead of the one provided by figwheel. As soon as I got rid of this dependency everything went back to working perfectly. |
@smee Did it also triy to load |
See keechma/forms#2 |
@smee Yeah, it looks like that's it - one of the packages I'm using has index.html in public folder. Thanks! |
So do I understand it correctly - now every package that has |
Not always, no. It depends on the order of dependencies in your classpath / the loading order as implemented by the classloaders utilized. My understanding is, that if you just use the classloader to load resources from the classpath, you may experience the error you observed. The only two ways to prevent this are to avoid having other public/index.html files on your classpath or patch figwheel so it manually traverses all dependencies, identifies its own public/index.html and loads that (with special code to handle exploded/packaged cases...), not very feasible. |
@smee Thanks, that was very insightful. Would it be helpful to short-circuit the index.html-manually-loading logic if a ring handler is provided? (My understanding is that that's how figwheel used to work.) |
I'm updating the Reagent template and I ran into a problem where Figwheel 0.5.4 will not server the
app.js
file fromtarget/cljsbuild/public/js/app.js
. This works correctly in 0.5.3-2. Here's a sample project.clj file.The text was updated successfully, but these errors were encountered: