We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
// webpack.config.js // (omitting requires) const plugins = [ new webpack.DefinePlugin({ __RELEASE_STAGE__: `'${stage}'`, }), new CleanWebpackPlugin(), new CopyWebpackPlugin({ patterns: [ { from: '**/*', context: path.resolve(__dirname, 'assets', stage), }, ], }), new HtmlWebpackPlugin({ template: './src/index.html', url }), new MiniCssExtractPlugin({ filename: '10ten.[contenthash].css' }), ]; module.exports = { mode, devtool: mode === 'production' ? 'source-map' : 'eval-source-map', entry: { 'main': ['./src/index.tsx'], }, resolve: { alias: { react: 'preact/compat', 'react-dom/test-utils': 'preact/test-utils', 'react-dom': 'preact/compat', }, extensions: ['.ts', '.tsx', '.js'], }, optimization: { splitChunks: { minChunks: 2, }, }, output: { path: path.resolve(__dirname, 'public'), publicPath: '/', filename: '[name].[contenthash].js', chunkFilename: '[name].[contenthash].js', }, module: { rules: [ { test: /\.tsx?$/, exclude: /node_modules/, use: 'ts-loader', }, { test: /\.css?$/, exclude: /node_modules/, use: [ { loader: MiniCssExtractPlugin.loader }, { loader: 'css-loader', options: { url: false, importLoaders: 1, }, }, { loader: 'postcss-loader', }, ], }, ], }, plugins, };
I am including the worker as follows:
const dbWorker = new Worker(new URL('./worker', import.meta.url), { /* webpackChunkName: 'db-worker' */ type: 'module', });
webpack-cli info
webpack-cli version
yarn webpack-cli info System: OS: Linux 4.19 Ubuntu 18.04.5 LTS (Bionic Beaver) CPU: (16) x64 Intel(R) Xeon(R) CPU E5-2637 v4 @ 3.50GHz Memory: 19.90 GB / 24.98 GB Binaries: Node: 14.16.0 - /tmp/yarn--1629418188271-0.35872703965539743/node Yarn: 1.22.5 - /tmp/yarn--1629418188271-0.35872703965539743/yarn npm: 7.19.1 - ~/.nvm/versions/node/v14.16.0/bin/npm Packages: clean-webpack-plugin: ^3.0.0 => 3.0.0 copy-webpack-plugin: ^9.0.1 => 9.0.1 html-webpack-plugin: ^5.3.2 => 5.3.2 webpack: ^5.50.0 => 5.50.0 webpack-cli: ^4.8.0 => 4.8.0 webpack-dev-server: ^3.11.2 => 3.11.2 webpack-merge: ^5.8.0 => 5.8.0
$ yarn webpack-cli version webpack 5.50.0 webpack-cli 4.8.0 webpack-dev-server 3.11.2
The worker is loaded.
Looking at the webpack output, it appears to be generated correctly:
asset db-worker.5f92a35b963c46fa4ad8.js 722 KiB [emitted] [immutable] (name: db-worker)
Furthermore, when not using dev server it is correctly referenced and loaded.
When using dev-server it attempts to look up db-worker.undefined.js which returns 404.
db-worker.undefined.js
After downgrading to 3.11.2 it works again.
The above configuration should do it. If that proves insufficient I will try to make time to create a minimal repro.
n/a
The text was updated successfully, but these errors were encountered:
Not related to webpack-dev-server, already reported to webpack itself
Sorry, something went wrong.
Here webpack/webpack#13801 (comment)
No branches or pull requests
Code
webpack.config.js
I am including the worker as follows:
Please paste the results of
webpack-cli info
andwebpack-cli version
here, and mention other relevant informationExpected Behavior
The worker is loaded.
Looking at the webpack output, it appears to be generated correctly:
Furthermore, when not using dev server it is correctly referenced and loaded.
Actual Behavior
When using dev-server it attempts to look up
db-worker.undefined.js
which returns 404.After downgrading to 3.11.2 it works again.
For Bugs; How can we reproduce the behavior?
The above configuration should do it. If that proves insufficient I will try to make time to create a minimal repro.
For Features; What is the motivation and/or use-case for the feature?
n/a
The text was updated successfully, but these errors were encountered: