mattlewis92 / webpack-retry-chunk-load-plugin

A webpack plugin to retry loading of chunks that failed to load
MIT License
234 stars 43 forks source link

Uncaught TypeError: {(intermediate value)} is not a function #53

Open shymkovayu opened 1 year ago

shymkovayu commented 1 year ago

Hello!

After updating to Webpack 5, I've run into an issue with the plugin. Everything builds fine if I remove the plugin, but if it's present I get this error: {(intermediate value)} is not a function

Screenshot 2023-06-13 at 13 57 43 Screenshot 2023-06-13 at 13 58 10

My setup: "react": "^17.0.2", "shakapacker": "^6.6.0", "webpack": "^5.85.1", "webpack-dev-server": "^4.15.0" "webpack-assets-manifest": "^5.1.0", "webpack-cli": "^5.1.3", "webpack-merge": "^5.9.0", "webpack-retry-chunk-load-plugin": "^3.1.1", (I've tried 2.2.0 too) "webpack-sources": "^3.2.3",

From webpack.config.dump (plugins part is the same with the plugin and without it):

optimization: {
    splitChunks: {
      chunks: 'all',
      minSize: 500000,
      minChunks: 1,
      maxAsyncRequests: 5,
      maxInitialRequests: 3,
      automaticNameDelimiter: '~'
    }
  },
output: {
    chunkFilename: '[name]-chunk-[contenthash].js',
    enabledChunkLoadingTypes: [ '...' ],
    enabledLibraryTypes: [ '...' ],
    enabledWasmLoadingTypes: [ '...' ],
    filename: '[name]-[contenthash].js',
    hotUpdateChunkFilename: 'js/[id].[fullhash].hot-update.js',
    path: '/public/packs',
    publicPath: '/packs/'
  },
plugins: [
    {
      cleanStaleWebpackAssets: true,
      protectWebpackAssets: true,
      outputPath: '/public/packs'
    },
    { resourceRegExp: /moment[\/\\]locale/, newContentRegExp: /\b\B/ },
    { outputPath: './', name: 'webpack.config.dump', depth: 4 }
  ],

Any thoughts/advices on how to resolve this? Any additional info needed?

bluthen commented 1 year ago

To me it looks liked installedCssChunks is missing a simicolan after }

I don't see css chunks support in my version of webpack, is there another plugin that chunks css that you use that maybe I'm not seeing? Maybe old version 4 extract-css-chunks-webpack-plugin?

I don't know if that is it, but hope it helps.