Skip to content

fix(host): getScriptSnapshot must also call fileNames.add#364

Merged
ezolenko merged 1 commit into
ezolenko:masterfrom
agilgur5:fix-host-get-snapshot
Jun 24, 2022
Merged

fix(host): getScriptSnapshot must also call fileNames.add#364
ezolenko merged 1 commit into
ezolenko:masterfrom
agilgur5:fix-host-get-snapshot

Conversation

@agilgur5

Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

watch mode Error: Could not find source file Could not find source file when running in watch mode with rollup-plugin-vue

2 participants