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

Watch mode has stale cache when using aliases #444

Closed
nfxpnk opened this issue Apr 9, 2023 · 2 comments · Fixed by #452
Closed

Watch mode has stale cache when using aliases #444

nfxpnk opened this issue Apr 9, 2023 · 2 comments · Fixed by #452
Labels
kind: bug Something isn't working properly scope: cache Related to the cache scope: integration Related to an integration, not necessarily to core (but could influence core) scope: watch mode Related to Rollup's watch mode

Comments

@nfxpnk
Copy link

nfxpnk commented Apr 9, 2023

Rollup Version

3.20.2

Operating System (or Browser)

Windows 10 latest

Node Version (if applicable)

18.13.0

Link To Reproduction

https://stackblitz.com/edit/rollup-repro-jz3iti?file=package.json
OR
https://github.com/nfxpnk/rollup-test

Expected Behaviour

  1. Run watch process: npm run watch
  2. Edit file test/flying-saucer/base/global/index.ts
  3. Watch process updates
  4. See builded file - dist-test/start.js
  5. New changes made in test/flying-saucer/base/global/index.ts present in builded file dist-test/start.js

Actual Behaviour

  1. Run watch process: npm run watch
  2. Edit file test/flying-saucer/base/global/index.ts
  3. Watch process updates
  4. See builded file - dist-test/start.js
  5. No changes in dist-test/start.js

If you will run just regular build with npm run build it works as expected.

Clean JS - not reproduceable - https://stackblitz.com/edit/rollup-repro-eghflu?file=rollup.config.js

@ezolenko ezolenko added kind: bug Something isn't working properly scope: watch mode Related to Rollup's watch mode labels Jun 20, 2023
@ezolenko
Copy link
Owner

ezolenko commented Jun 20, 2023

Reproduces, likely happens because of imports resolved by @rollup/plugin-alias are not marked as dependencies for the importing file and cached version is returned. Solution would probably be running imports through rollup resolver and adding results as additional dependencies.

Works if I change all imports to relative paths and comment out alias.

Also works if cache is disabled with clean: true option on rpt2.

@ezolenko
Copy link
Owner

ezolenko commented Jun 23, 2023

Cache is disabled during watch mode in 0.35.0 now

@agilgur5 agilgur5 changed the title Watch process not updating file Watch mode has stale cache when using aliases Jun 30, 2023
@agilgur5 agilgur5 added scope: integration Related to an integration, not necessarily to core (but could influence core) scope: cache Related to the cache labels Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working properly scope: cache Related to the cache scope: integration Related to an integration, not necessarily to core (but could influence core) scope: watch mode Related to Rollup's watch mode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants