-
Notifications
You must be signed in to change notification settings - Fork 64
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
defroute is undefined when compiled with sourcemap build settings #14
Comments
Typically I don't use |
Hmm, using I tried settings :source-map to "main.js.map" which worked but jacked my |
@kevincolyar That certainly is not the case. You can see an example here.
Yeah, that sounds about right. You'll have to decide whether it's worth the wait or not (or get a quad core 😄). A good combination is to use something like austin and work with a bREPL to get faster feedback. |
@noprompt thanks for the example! I'm using om too so that will be helpful. I'll try messing with my index.html setup to see if I'm doing something wrong there. I'll take another look at austin, too. Thanks for the help. |
I think I've narrowed down the issue to this line which seems to be required when using a source-map directory. <script type="text/javascript">goog.require("activity_log.core");</script> I don't understand well enough how secretary's defroute macro is working to know why wouldn't be defined when requiring this file that defines my routes. Here's all of my js includes: <script src="http://fb.me/react-0.9.0.js"></script>
<script src="out/goog/base.js" type="text/javascript"></script>
<script src="main.js" type="text/javascript"></script>
<script type="text/javascript">goog.require("activity_log.core");</script> From what I can tell, the goog.require is starting my application. I don't have to use this line when I build in release because I'm not using source maps output directory: :cljsbuild {
:builds [{:id "dev"
:source-paths ["src"]
:compiler {
:output-to "main.js"
:output-dir "out"
:optimizations :none
:source-map true}
}
{:id "release"
:source-paths ["src"]
:compiler {
:output-to "main.js"
:optimizations :advanced
:pretty-print false
:preamble ["react/react.min.js"]
:externs ["react/externs/react.js"]}
}]}) |
@kevincolyar I'm thinking that the two builds are compiling to the same output file. Can you please try naming the different builds to output to different js files and update the index.html to point to the right one? i.e. |
I'm trying to use secretary in conjunction with om and it works fine using the release cljsbuild settings, however the development settings don't work. I'm not sure if it's the source map that's messing it up or the js include in the index.html.
https://github.com/swannodette/om#using-it
Using the following dev build settings I get an error that defroute is undefined:
The text was updated successfully, but these errors were encountered: