-
Notifications
You must be signed in to change notification settings - Fork 9
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
"Uncaught ReferenceError: Fay is not defined" with yfsSeparateRuntime #12
Comments
It might just be that we can no longer provide |
Just came across this myself. The problem is that Fay code output was originally wrapped in an IIFE, then at some point that was undone, which is an invariant that this splitting of runtime and application code depended on. Now the wrapper is back, that invariant is broken, so the IIFE delimits the scope of the |
I have set
@cies did you have to do anything else to get it working? I also tried including _update:_ managed to sort it out by hard-coding it as script tag into the layout right at the bottom |
maybe I dont understand your question well. myself I dont have any fay_*_js getHome ..... = do On Mon, Sep 22, 2014 at 1:04 PM, Karsten Gebbert notifications@github.com
|
No, I meant to ask how you add-in the runtime. Just setting Sorry for the confusion :) |
Okay, I've pushed a commit 6b7cde8 which fixes this.
In development your If you change this setting, remember to |
I don't know if this is the right place to mention it, and I don't know if what I mention below is an issue. Yet after spending a lot of time hunting this one down, I feel the need to document my findings in hope that it may help someone who encounters the same.
At first I raised an issue at fay-jquery but I was wrong about that...
The JS error I got in my Chrome browser was:
It is caused by the
yfsSeparateRuntime
not being set toNothing
in theSettings.hs
.The reason for this setting to cause the error is -- by my best analysis -- that the
fay-runtime.js
gets loaded before the application's JS file, while the runtime code refers toFay.FFI.*
functions that are only defined in the application code.The best/quick solution I saw was merging the files into one; luckily setting
yfsSeparateRuntime
toNothing
in theSettings.hs
does just that.The fact that the runtime code needs functions from the application code leaves me with a bit of a weird feeling.
The text was updated successfully, but these errors were encountered: