-
Notifications
You must be signed in to change notification settings - Fork 42
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
[Bug] Stale virtual module contents upon ".writeModule" #89
Comments
I'm expecting the |
same problem in webpack5 |
Have same problem, anyone resolved this? |
I've been having the same issue of everything working on build but nothing happens during watch mode. I've been able to localize it to this line for webpack5: webpack-virtual-modules/src/index.ts Line 165 in c455958
All the uses of However I'm still not getting any compiled output. It's as if webpack sees the event but decides that nothing has happened and skips outputting anything. EDIT: |
Closing the issue as stale, please retest on latest |
Describe the bug
I have a file system watcher (
gatsby-page-utils
). I derive a JSON from the file changes (addition/removal) of a given directory. I then use your plugin to write the contents of that JSON as a virtual module for my build.The issue is that when a file is added/removed, although
.writeModule
is called with the right JSON, the value of the virtual module remains stale. Actually, I believe it remains the same as when the build was done. Nothing changes the value: working with files, changing the build's entrypoint.To Reproduce
yarn install && yarn build
yarn reproduce
. This will open a local dev server.entry.js
) in the console.*.js
files in theexamples/virtual-issue
directory.You can observe the value of the
serializedPages
in theFileRouterPlugin
plugin to see that.writeModule()
call receives updated value.Environment if relevant (please complete the following information):
Additional context
I'm building a plugin that represents a given directory as a JSON, watches for changes, and exposes that JSON to your bundle. I'd love to use your plugin underneath to provide that JSON as a virtual module. Thank you for creating this plugin!
The text was updated successfully, but these errors were encountered: