Closed boris-petrov closed 6 years ago
Please ignore this. We're using the ember-template-compiler on the backend to compile some stuff and tried using version 0.35.0
with Ember 3.2.0
which caused this problem. Sorry for the confusion.
FWIW, you really should be using the file bundled with ember-source (and not use @glimmer/compiler
directly). Ember adds a number of features which are not included in glimmer compiler via ast transforms that are automatically ran for each compiled template. If you use @glimmer/compiler
directly it will definitely not emit the same output...
@rwjblue - thanks for the information! We have this on the BE:
var compiler = require('@glimmer/compiler');
function main(template) {
return JSON.parse(compiler.precompile(template));
}
And then we send this to the FE for use from Ember. You're saying that we should not do this but rather something like:
var compiler = require('ember-source/dist/ember-template-compiler.js');
// same code after that
Am I understanding you correctly?
Yes! Exactly!
After upgrading from
3.1.2
to3.2.0
, we get the following error:Please tell me if you need more information.