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

Apollo extension support #267

Closed
guybedford opened this issue Feb 26, 2022 · 5 comments
Closed

Apollo extension support #267

guybedford opened this issue Feb 26, 2022 · 5 comments

Comments

@guybedford
Copy link
Owner

Reopening this one due to a comment by thewoolleyman.

I posted what should have been a fix in #201 that should have resolved the issue where an early module load by an extension blocks import maps. Apparently this doesn't seem to be applying in some cases so it would be worth reinvestigating.

@thewoolleyman if you have a replication you can share on this / any further info that would still be a huge help.

@thewoolleyman
Copy link

@guybedford I have reproduced the problem in a new Rails 7 application.

Here's the repo (a new rails 7 app with a scaffold_controller page), with a link to the commit that adds es-module-shims to the page: thewoolleyman/rails-importmap-example@c9c8add

Here's the error in the console, where you can see it's still getting an error even with the shim script line included:

Screen Shot 2022-02-27 at 10 59 25 PM

I may be using the shim wrong, if so please let me know what's the correct way.

Thanks,
-- Chad

@thewoolleyman
Copy link

@guybedford Also, I just realized that the importmap-rails gem already includes the shim (that's why it shows up twice in my screenshot): https://github.com/rails/importmap-rails/blob/a5740f0b2cfd751f5fe09ce49d7cbd47e99eb25a/app/helpers/importmap/importmap_tags_helper.rb#L30

@guybedford
Copy link
Owner Author

@thewoolleyman thanks for the update - so ES Module Shims won't fix the error, instead it will execute the code so that the error is corrected. This is what that last comment is trying to inform about.

So the replication should include a test that the code is running, not be based on these error messages which are certainly expected. Is the code definitely not working?

@guybedford
Copy link
Owner Author

I mean the last console log in the screenshot, not the last "comment" in the above.

@guybedford
Copy link
Owner Author

Closing since as far as I can tell from the screenshot ES Module Shims is working correctly and running in polyfill mode.

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

2 participants