Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Caching issues with @parcel/resolver-glob #7247

Closed
silvenon opened this issue Nov 4, 2021 · 3 comments
Closed

Caching issues with @parcel/resolver-glob #7247

silvenon opened this issue Nov 4, 2021 · 3 comments
Labels
Resolver Stale Inactive issues

Comments

@silvenon
Copy link

silvenon commented Nov 4, 2021

🐛 bug report

I've found some caching issues and errors related to @parcel/resolver-glob when adding and deleting files in the glob path.

🎛 Configuration (.babelrc, package.json, cli command)

CLI command:

parcel index.html

.parcelrc:

{
  "extends": "@parcel/config-default",
  "resolvers": ["@parcel/resolver-glob", "..."]
}

🤔 Expected Behavior

Adding and removing files in globbed path should automatically update everything, including refreshing the page.

😯 Current Behavior

  • adding new files inside the glob path doesn't refresh the page
  • deleting a file inside the glob path causes a no such file or directory error that doesn't go away until I delete the cache (simply restarting Parcel doesn't work because the error gets cached), or if I add a new file

🔦 Context

I have a posts directory containing MDX files, so I'm importing them using import posts from "./posts/*.mdx" and rendering the post based on the URL, e.g. /post/my-post will render posts['my-post'].default.

💻 Code Sample

I created a repository where you can reproduce these issues, first start Parcel with npx parcel index.html. To reproduce the first issue you can add a new file in globbed, for example d.js, and see that the content wasn't updated, and that it still says "Loaded modules: a.js, b.css, c.js". d.js will be displayed once you reload the page manually. To reproduce the second issue delete any file in globbed, notice that the error doesn't go away despite refreshing the page or restarting Parcel, either delete the cache or add a new file in globbed.

🌍 Your Environment

Software Version(s)
Parcel 2.0.0
Node v16.13.0
npm 8.1.0
Operating System macOS 11.6
@mischnic
Copy link
Member

mischnic commented Nov 4, 2021

Related: #6875 and #6874

@silvenon
Copy link
Author

silvenon commented Nov 4, 2021

I missed those when searching, sorry. 😅

@github-actions
Copy link

github-actions bot commented May 7, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label May 7, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Resolver Stale Inactive issues
Projects
None yet
Development

No branches or pull requests

2 participants