Closed gossi closed 3 weeks ago
Do you have a PR where this is easily reproducible?
Potentially related:
Here is a PR: https://github.com/gossi/ember-command/pull/22
But I think, I failed on CI setup for github, so must be done locally:
pnpm install
pnpm --filter ember-command run build
cd test-app/ && ember s
Notes:
Rendering | Component | <CommandElement>: invoke command
EMBROIDER_TEST_SETUP_FORCE='embroider' ember s
that test will pass.Also, I left a comment to this issue within the code to see when I left workarounds. Search for https://github.com/embroider-build/ember-auto-import/issues/588
inside the code.
My workaround: duck-typing and __***__
properties instead of symbols 😞
@NullVoxPopuli that is exactly the issue. The module graph essentially creates two different copies of the module so when you import something from a test file it can never be ===
something that is imported in an app 😞
I am trying to convert a legacy addon into a v2 addon in a project using ember-auto-import and I think I am running into this as well
If the issue here is indeed related to https://github.com/embroider-build/ember-auto-import/issues/503, then I think we can close this now, as the bug has been fixed a wile ago! Can someone confirm?
I took recent main branch from ember-command
today with ember-auto-import@2.7.4
to run the try exam with the ember@3.28
and that worked.
I think, this means, this can be closed. Thanks a lot everybody :)
I'm rewriting
ember-command
as v2 addon. The check I have there to test for links are:To ensure embroider compatibility I'm using ember-try for with embroider scenarios. By default, when starting locally, it uses classic mode.
Now I've realized the checks above are failing in classic mode. As these are two different imports under the hood for
Link
andLinkCommand
between the transpiled addon and the host app, thus the tests are failing. My theory is, due to the different locations and two different memory pointers, that's why the checks fail.My workaround was to use a symbol, attach it to the
LinkCommand
and check for the existence of the symbol... it is failing, too (I think for the same reason).When starting the test app in embroider mode:
EMBROIDER_TEST_SETUP_FORCE='embroider' ember s
the checks work as expected.