-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
un-useful error message compiling template #19496
Comments
Can you provide the full stack trace? This seems like a really strange error. There were some breaking changes to the private template transforms API, which some addons do make use of, so I wonder if it could be related to that. |
@pzuraq I've been going in circles trying to upgrade to ember 3.25 for a few weeks and (just a hunch) I just realized that commenting out
Here's a full stack trace :
|
In hopes it helps identify the root cause, I've been poking around and managed to get templates to compile by editing the _proto13.spanFor = function spanFor(_ref12) {
+ if (typeof _ref12 === 'undefined') {
+ return SourceSpan.forHbsLoc(this, {
+ start: { line: 0, column: 0 },
+ end: { line: 0, column: 0 }
+ });
+ }
var start = _ref12.start,
end = _ref12.end;
return SourceSpan.forHbsLoc(this, {
start: {
line: start.line,
column: start.column
},
end: {
line: end.line,
column: end.column
}
});
}; Unsurprisingly, now I get some runtime errors here and there :
|
@jdurand can you provide a reproduction? We have templates just like this in tests, and they work as expected. Something else must be going on here to cause these errors, but I haven't been reproduce myself. |
@pzuraq here's a repo the reproduces the issue: https://github.com/jdurand/ember-source-issue-19496 |
@jdurand removing The solution will be to update |
Interesting. I was using ember hammer time via ember-gestures. I've removed ember-hammertime now as it's deprecated. |
Thanks @pzuraq. Linking these related issues for future reference : |
Just a little update in case someone else faces the same deprecation scenario. // app/modifiers/on-swipe-right.js
import { modifier } from "ember-modifier";
import * as Hammer from 'hammerjs';
export default modifier((element, [fn]) => {
const containerManager = new Hammer.Manager(element);
const swipe = new Hammer.Swipe({
direction: Hammer.DIRECTION_RIGHT,
threshold: 10,
});
containerManager.add(swipe);
containerManager.on('swiperight', fn, { passive: true });
return () => {
containerManager.destroy();
}
}); <div
- {{recognize-gesture "swipe"}}
- {{on 'swiperight' (fn this.swipeRight @item)}}
+ {{on-swipe-right (fn this.swipeRight @item)}}
>
{{yield}}
</div> |
I'm doing some issue gardening 🌱🌿 🌷 and came upon this issue. It seems outdated and likely no longer relevant. By closing some old issues we reduce the list of open issues to a more manageable set. Let me know if you think this is a mistake and that the issue should stay open. |
Upgrading an old application to Ember 3.26.
Expected
Compiles successfully or logs useful error message
Actual
The problem seems to be the action. Removing it fixes the error.
Obviously we shouldn't be doing this any more, and using a
button
with theon
modifier instead. But the compiler error message does not help the developer find the problem and fix it.Fix 1: Show location of error in .hbs file (line, column)
Fix 2: Help the developer know what they've done wrong. Old tutorials will have developers writing code like this.
EDIT: Now happening with
<div><button type="button"/></div>
The text was updated successfully, but these errors were encountered: