propshaft icon indicating copy to clipboard operation
propshaft copied to clipboard

Maybe another race condition with webpack in development

Open neontuna opened this issue 9 months ago • 4 comments

This may be a slight variation of https://github.com/rails/propshaft/issues/110 and I was hopeful that the 0.9.0 release would resolve but it hasn't

This is also hard to reproduce, although I currently have our app in a state locally where its constantly occurring so I can at least test possible solutions

We use Vuejs imported in application.js and compiled by webpack and jsbundling. I'll make a change to a Vue file, webpack will compile application.js, I'll reload the page and I'm met with a white screen and the following error in console

image Screenshot 2024-05-22 at 8 23 59 PM

The only way to resolve is to completely restart the rails server

So this seems like maybe that same chunking issue? I've tried digging into Propshaft itself to troubleshoot more but I'm not sure what I should be looking for - there's no errors from webpack cli or the rails console.

So far I've tried randomly bumping versions, from ruby 3.3.0 to 3.3.1. node 16 to 21. I also updated our webpack.config.js with the chunking options here https://github.com/rails/jsbundling-rails/blob/main/docs/switch_from_webpacker.md#optional-use-webpack-to-chunk-assets-so-that-it-works-with-sprockets

  output: {
    filename: "[name].js",
    chunkFilename: "[name]-[contenthash].digested.js",
    sourceMapFilename: "[file]-[fullhash].map",
    hashFunction: "sha256",
    hashDigestLength: 64,
    path: path.resolve(__dirname, '..', '..', 'app/assets/builds'),
  },

neontuna avatar May 23 '24 00:05 neontuna