This assertion seems to allow only scopes defined as { foo } or { foo: foo }, but not { foo: bar }. I wonder why that is?
The problem I was running into:
I am using rollup-plugin-glimmer-template-tag and rollup-plugin-ts in a v2 addon, I was importing the default export of a component HeadlessFormFieldComponent under a shorter name, like this:
import FieldComponent from './field';
But during the compilation process (/dist output of v2 addon), this gets implicitly transformed to something like this:
Idk why this is being done, but it seems perfectly valid from a pure JS standpoint. But the babel plugin then throws Scope objects for precompileTemplate may only contain direct references to in-scope values, e.g. { FieldComponent } or { FieldComponent: FieldComponent }
Similar things happen when you import by assigning an alias, like
import { EnsureSafeComponentHelper as ensureSafeComponent } from '@embroider/util';
This assertion seems to allow only scopes defined as
{ foo }
or{ foo: foo }
, but not{ foo: bar }
. I wonder why that is?The problem I was running into:
I am using rollup-plugin-glimmer-template-tag and
rollup-plugin-ts
in a v2 addon, I was importing the default export of a componentHeadlessFormFieldComponent
under a shorter name, like this:But during the compilation process (
/dist
output of v2 addon), this gets implicitly transformed to something like this:Idk why this is being done, but it seems perfectly valid from a pure JS standpoint. But the babel plugin then throws
Scope objects for precompileTemplate may only contain direct references to in-scope values, e.g. { FieldComponent } or { FieldComponent: FieldComponent }
Similar things happen when you import by assigning an alias, like
...which gets rewritten to