-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Ensure export= symbol from JavaScript always has a valueDeclaration #34553
Conversation
I'm conflicted on this - I'm not sure it's right to set a value declaration on something which lacks the flags to indicate that it's a value (so I question #26973, too). How do we fall into |
Doesn't this get fixed by #34543 |
No, still fails. I just tested it. =( |
#34493 seems like it is exactly the same bug, but this change doesn't fix it. Not sure why yet. |
What is the crash like here? I think this might be OK for a fix, but I would like to understand better why it was crashing. |
Uhm, I don’t think so?
|
The most surface-level solution would be to fall back to
@weswigham is the latter an accurate representation of what you’re saying? |
Given the stack, this sounds like the right fix to me -- this fails because a commonjs "alias" isn't a real alias, but we have to report errors on it correctly in the middle of module resolution. |
By “this” do you mean the one I described in the previous comment, or the one currently in this PR? |
The one in the PR, not using |
Oh, well, I guess we should do the same. Seems odd to me, though - it means that you can have a .valueDeclaration for a thing that... Isn't a value. |
I encountered this bug while chasing #34481, but I think it’s ultimately unrelated (though might be @Jack-Works’ bug in that thread?)
There’s a preexisting assumption that the
export=
symbol always has a valueDeclaration (see #26973), but exports of aliases in JS weren’t setting valueDeclarations. I’m not sure if doing this without theSymbolFlags.Value
flag is correct—I’m not 100% clear on what the criteria for setting valueDeclaration is supposed to be.