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

1.11.0-beta.1+canary.8... "Cannot call 'compile' without the template compiler loaded" #10265

Closed
himansudesai opened this issue Jan 22, 2015 · 21 comments

Comments

@himansudesai
Copy link

Hi - I have a ember component wrapper library for jQueryUI with examples hosted on github. It is not a CLI app. Things used to work until 1.10 but with 1.11, I get an error: Cannot call 'compile' without the template compiler loaded. Please load 'ember-template-compiler.js' prior to calling 'compile'.
I downloaded and included ember-template-compiler.js but of course without the full CLI machinery, it gives me a "ReferenceError: exports is not defined"

Has the on-the-fly compiling been taken out of the latest canary? If so, how does one work around this.
Handlebars version = 2.0.0
Thanks
broken example at: http://himansudesai.github.io/examples/slider-component.html

@thejchap
Copy link
Contributor

Replicated here as well http://emberjs.jsbin.com/tafoyayalo/1/edit?html,output

@workmanw
Copy link

I think you guys just need to include "ember-template-compiler.js".

@thejchap http://emberjs.jsbin.com/ludukidili/2/edit

@rwjblue
Copy link
Member

rwjblue commented Jan 23, 2015

Thank you @workmanw, that is absolutely correct.

@rwjblue rwjblue closed this as completed Jan 23, 2015
@himansudesai
Copy link
Author

Hi @rwjblue, @workmanw - I'll gladly retry including ember-template-compiler.js and report back. However, as mentioned in the original issue, that leads to a "ReferenceError: exports is not defined" error. It could be other ES6 related changes getting mixed into this, but simply including the ember-template-compiler does not do the trick. If I switch from ember 1.11 back to 1.10 (both with Handlebars 2.0), everything works just fine.
Thanks

@thejchap
Copy link
Contributor

@workmanw thanks!

Is this a temporary issue or is there documentation we/should can contribute somewhere?

@rwjblue
Copy link
Member

rwjblue commented Jan 23, 2015

FYI - Handlebars is no longer needed as of 1.10.

This is not temporary. I am supposed to be writing a blog post explaining the new template compilation process. Better get on that :)

@himansudesai
Copy link
Author

@thejchap Huh - that worked for you? Which one of the many available ember-template-compiler.js did you use? I used the one from npm and get "ReferenceError: exports is not defined. Since my library has live examples, I'm desperate to get them working again. Pl. advise offline at himansudesai@gmail.com if this is getting too voluminous for the issues page.
I'll try @rwjblue suggestion to remove handlebars

@himansudesai
Copy link
Author

@rwjblue Will wait for your writeup and thanks for all the hard work and recent improvements. Currently, I get a [ Uncaught TypeError: Cannot read property 'COMPILER_REVISION' of undefined ] at ember-template-compiler.js - LINE 38, if I include the compiler but not handlebars. Thanks!

@rwjblue
Copy link
Member

rwjblue commented Jan 24, 2015

Please make sure you are using the ember-template-compiler.js that is published for your specific build.

@rwjblue
Copy link
Member

rwjblue commented Jan 24, 2015

That sounds like the old ember-template-compiler package, not the file thay is paired with your ember build.

@himansudesai
Copy link
Author

@rwjblue I'll bet you are right. Sorry for sounding like a noob (which I am) but I don't know how to find the right pairing. I thought the one I am using might be old because it was published by you on npm 3 months ago. I went to emberjs.com/builds/#canary and there is obviously no mention of ember-template-compiler there. Thanks!!

@himansudesai
Copy link
Author

@rwjblue Found the URL in one of your Ember JSBin Examples - nice! <.../canary/ember-template-compiler.js> Easy enough URL to remember.
P.S. Some of your canary based examples are currently broken because they are missing the ember-template-compiler. Can go through each and compile a list of broken ones for you, if you wish...

@yankeeinlondon
Copy link

Hi folks, wanted to chime in that I have run into the same problem with Ember 1.10.0-beta.4 and as I'm using CLI (v0.1.12) I thought the manual inclusion of the compiler mentioned above would simply be a matter of adding the following to my Brocfile:

 app.import('bower_components/ember/ember-template-compiler.js');

I've done that but am still getting the same compile error. In want amounts to an act of desperation I switched the HTMLbars on and off (all the while cursing under my breath) and noticed no variation in the message. That surprised me but then I'm not nearly close enough to the intricacies/dependencies of HTMLbars).

Anyway, with a small new project just starting I wanted to hit the cutting edge of Ember but am now wondering if I must step back from the edge a little. Any help getting back out on the edge would be very much appreciated.

@himansudesai
Copy link
Author

@ksnyde As @rwjblue said, use the compiler that is paired with a particular release of ember. I've identified a pattern for canary which should also work for 1.10.0-beta.4.

I've verified that there is a ember-template-compiler.js at that URL.

The pattern is <prefix_to_emberxxx.js>/ember-template-compiler.js
In your case, it is:
http://builds.emberjs.com/beta/ember-template-compiler.js

@yankeeinlondon
Copy link

@himansudesai I am I believe, unless I'm being thick the compiler version comes with the version of ember you've picked with bower. Doesn't it? What is the scenario where the compiler and Ember version become out of sync?

In my case, I tracked the problem down to my use of the ember-cli-bootstrap-sass plugin which was also including the now quite dusty bootstrap_for_ember components. I've created a ember-cli-bootstrap-sassy plugin which removes this unwanted dependency and all is well again.

@himansudesai
Copy link
Author

@ksnyde You are right. In my case, I was using ember straight and had some trouble locating the correctly paired version of ember-template-compiler. Since you were getting an identical error, I figured you had a mismatched pair as well. Glad you tracked your issue down.

@jesuskwice
Copy link

@ksnyde -- how did you track down your problem? I'm not using bootstrap, so can't benefit from your plugin, but I am facing the same issue and curious how to identify what my culprit may be.. Any insight?

Should include that I'm running Ember 1.10.0 and CLI 0.1.12 (attempting to get ember-cli-rails to work with my setup)

@yankeeinlondon
Copy link

@jesuskwice for me it was just a matter of removing the aging "ember-cli-bootstrap-sass" plugin (see above) because it was loading "bootstrap_for_ember" which had dependency problems. Typically the compiler should automatically matchup without issue but I guess if you're doing some off-sheet template compiling maybe it is more complicated? Good luck getting this sorted.

@jesuskwice
Copy link

@ksnyde I don't really have any stringent limitations on my use case -- mainly just trying to get ember-cli to play nice with rails (tried a number of different approaches to no avail). Still tinkering around with this a bit before I have to drop hopes of this though. Thanks!

@sberan
Copy link

sberan commented May 15, 2015

I ran into this issue as well, adding

app.import('bower_components/ember/ember-template-compiler.js');

to my Brocfile.js fixed it.

@nitin-daffodil
Copy link

hey which brocfilte you are taking

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

8 participants