Skip to content
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

Import sync collides with ember-auto-import #1254

Open
anehx opened this issue Sep 9, 2022 · 5 comments
Open

Import sync collides with ember-auto-import #1254

anehx opened this issue Sep 9, 2022 · 5 comments

Comments

@anehx
Copy link

anehx commented Sep 9, 2022

Hi

I've been having problems using importSync in combination with getOwnConfig - that's when I opened #1138. Now I finally found the actual problem that I was having: As soon as I move ember-auto-import in an addon from devDependencies to dependencies I get the following error:

embroider-import-sync/components/foo.js: import() is only allowed to contain string literals or template string literals
   8 |   get barComponent() {
   9 |     return ensureSafeComponent(
> 10 |       importSync(getOwnConfig().barComponent).default,
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  11 |       this
  12 |     );
  13 |   }

Without ember-auto-import in dependencies everything works as expected. However, ember-auto-import needs to be in there in order to work properly in addons. Am I missing some configuration that needs to be done or is this a bug?

I made a minimal reproduction to demonstrate the issue: https://github.com/anehx/embroider-import-sync

Thanks for checking!

@anehx
Copy link
Author

anehx commented Jun 22, 2023

Hi guys

Just checking if anyone managed to take a look at this. In the current state, importSync is not usable as it doesn't work in combination with ember-auto-import which is used in lots of projects.

I would really appreciate if someone could take a look at this!

@void-mAlex
Copy link
Collaborator

hello @anehx thanks for the report and follow up I'll bring this up at the next team meeting next Tuesday if nobody manages to look till then

@anehx
Copy link
Author

anehx commented Jun 22, 2023

Thanks @void-mAlex, I really appreciate it! Let me know if I can do anything to help.

@anehx
Copy link
Author

anehx commented Dec 8, 2023

Is there any progress on this issue?

@derrabauke
Copy link

🆙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants