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

Cannot read properties of null (reading 'source') #5

Closed
Dhaulagiri opened this issue Apr 11, 2022 · 2 comments · Fixed by #6
Closed

Cannot read properties of null (reading 'source') #5

Dhaulagiri opened this issue Apr 11, 2022 · 2 comments · Fixed by #6

Comments

@Dhaulagiri
Copy link

Version 1.2.0 of this package has, I think?, introduced a bug we noticed in this CI run as an example:

/home/runner/work/design-system/design-system/packages/components/@hashicorp/ember-flight-icons/components/flight-icon.js: Cannot read properties of null (reading 'source')TypeError: /home/runner/work/design-system/design-system/packages/components/@hashicorp/ember-flight-icons/components/flight-icon.js: Cannot read properties of null (reading 'source')

Pinning to 1.1.0 seems to fix the issue.

ef4 added a commit that referenced this issue Apr 11, 2022
The changes in #3 made babel aware of our newly-inserted import specifiers, which causes it to schedule visits on them. If subsequent code removes them again before they've been visited, babel still visits them but passes paths with a broken parent.

Explicitly removing all specifiers seems to convince babel to remove them from its scheduled visit queue.

Fixes #5
@ef4 ef4 closed this as completed in #6 Apr 11, 2022
@ef4
Copy link
Owner

ef4 commented Apr 12, 2022

#6 was enough to fix this for some cases, but it's still possible for other plugins to trigger the bug. Full fix will be in #7. I think we just can't trust this babel API given how inconsistent plugins are about how they mutate AST.

@Dhaulagiri
Copy link
Author

Thanks for the quick fix!

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

Successfully merging a pull request may close this issue.

2 participants