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

getSymbolResolution: fallback to asset's symbol with non-static dependencies #7944

Merged
merged 2 commits into from
Apr 13, 2022

Conversation

mischnic
Copy link
Member

@mischnic mischnic commented Apr 12, 2022

Previously, getSymbolResultion would return null in a situation like this (can be caused by importing bufferand also using the global or using __filename while also importing path manually).

Now, it will fallback to the symbol that the asset declares (asset.symbols.get("foo")), which will work fine if the asset doesn't reexport said symbol. If if that symbol was reexported (and has the value $id1$export$id2) then there will definitely have been a dependency with symbols and the corresponding mapping.

This doesn't trigger the Asset was skipped or not found. assertion in the general case because many instances of getSymbolResolution returning null to fallback are handled gracefully (by falling back...). But when building a library, the symbols of the entry have to be determined.

This whole duplicate dependency and missing symbols problem isn't ideal, but this could also occur with two unrelated dependencies. I couldn't think of a reproduction outside of the buffer/path globals.

AssetGraph_Main

@devongovett devongovett merged commit 0e2ebd5 into v2 Apr 13, 2022
@devongovett devongovett deleted the filepath-asset-skipped branch April 13, 2022 01:52
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.

2 participants