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(host): getScriptSnapshot must also call fileNames.add #364

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

agilgur5
Copy link
Collaborator

Summary

Make getScriptSnapshot match/call setSnapshot. Previously, a this.fileNames.add call was added to setSnapshot but not getScriptSnapshot, causing a Could not find source file error.

Details

See #271 (comment) and my other comment above it for a root cause analysis.

- the `fileNames` Set that was previously introduced in c86e07b caused a regression during watch mode
  - this is because `setSnapshot` was updated to call `this.fileNames.add`, but `getScriptSnapshot` was not
    - instead of updating both to be the same, we can just call `setSnapshot` from `getScriptSnapshot` as this code is supposed to be identical
      - also rename `data` -> `source` for consistency and clarity (`source` is a more specific name)
@agilgur5 agilgur5 added kind: regression Specific type of bug -- past behavior that worked is now broken scope: watch mode Related to Rollup's watch mode labels Jun 22, 2022
@ezolenko ezolenko merged commit b258497 into ezolenko:master Jun 24, 2022
@agilgur5 agilgur5 linked an issue Aug 23, 2022 that may be closed by this pull request
@agilgur5 agilgur5 deleted the fix-host-get-snapshot branch July 2, 2023 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: regression Specific type of bug -- past behavior that worked is now broken scope: watch mode Related to Rollup's watch mode
Projects
None yet
2 participants