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

Fix importName type confusion (string, bool, node) #233

Merged
merged 1 commit into from
Jul 1, 2019

Conversation

ZauberNerd
Copy link
Contributor

Apparently importName can have many different types:
#232 (comment)

This commit ensures that the check whether the name is in the scope
(bindings) does not break on plain strings.

Closes: #232

Apparently `importName` can have many different types:
styled-components#232 (comment)

This commit ensures that the check whether the name is in the scope
(bindings) does not break on plain strings.

Closes: styled-components#232
ZauberNerd added a commit to xing/hops that referenced this pull request Jul 1, 2019
The `babel-plugin-styled-components` introduced a bug in v1.10.3 which
causes our builds to get stuck endlessly.

This commit temporarily restricts the version range of the babel plugin
to the safe versions until the bug is fixed upstream.

See this PR and its linked issue for more details:
styled-components/babel-plugin-styled-components#233
ZauberNerd added a commit to xing/hops that referenced this pull request Jul 1, 2019
The `babel-plugin-styled-components` introduced a bug in v1.10.3 which
causes our builds to get stuck endlessly.

This commit temporarily restricts the version range of the babel plugin
to the safe versions until the bug is fixed upstream.

See this PR and its linked issue for more details:
styled-components/babel-plugin-styled-components#233
Copy link
Collaborator

@quantizor quantizor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, makes sense I think. Thanks for looking into this!

@agriffis
Copy link
Contributor

@ZauberNerd I know this is a couple years later, but are you still around to talk about this?

I'm confused by this line of code:

   if (!importName || !bindings[importName.name] || !bindings[importName]) {

It seems to me that this will always evaluate to true. Either importName is a string, so bindings[importName.name] will be undefined, or importName is an object, so bindings[importName] will be undefined.

Should it be:

   if (!importName || !bindings[importName.name || importName]) {

or maybe a typeof check?

@ZauberNerd
Copy link
Contributor Author

@agriffis looks like you're correct and it was an oversight on my part.

@ZauberNerd ZauberNerd deleted the fix-importname branch January 3, 2022 10:11
@agriffis
Copy link
Contributor

agriffis commented Jan 3, 2022

@ZauberNerd Thanks for the reply! Not sure yet about next steps on this, I think any change in this area would deserve additional tests to make sure it's working as intended. But I appreciate your following up to my question.

agriffis referenced this pull request Mar 5, 2022
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 this pull request may close these issues.

Next.js app stuck on "compiling" with version >= 1.10.3
3 participants