I basically need an attribute which runs once and it will calculate the style.top and style.right when bind occurs.
Now I do have a project, which was ok, -until- I added this ts file.
import {autoinject} from ‘aurelia-framework’; @autoinject
export class SetPositionCustomAttribute {
Problem is that now suddenly, au run fails.
ERROR [BundledSource] Could not convert to AMD module, skipping src\custom\setpositionattribute.ts
ERROR [BundledSource] Error was: SyntaxError: unknown: Support for the experimental syntax ‘decorators-legacy’ isn’t currently enabled (2:1):
For the obvious questions: Did you enable/disable I add tsconfig.json
Yes that’s definitely the issue. Had the same a while back. As explained only the more generic Element gets injected since DI doesn’t know whether it’s HtmlElement or SvgElement. So you would need to cast it manually
But the error remains. It’s as it as if the file is not part of the project.
Support for the experimental syntax ‘decorators-legacy’ isn’t currently enabled (2:1):
Guess your ide just accidentally autocompleted the file ending. @hiaux0 could this be e.g handled by the vscode extension to provide a custom linting error if the file ending is detected?
While it’s no tremendous feature it would certainly help debugging issues with non-descriptive errors like here. And let’s be honest once in a while everyone from us falls into something like this