No default export found in imported module "copy-webpack-plugin" in webpack.config.ts
Closed this issue · 1 comments
katinthehatsite commented
Bug report
When I am using the CopyWebpackPlugin (the most recent version) in webpack.config.ts
, I am getting an error No default export found in imported module "copy-webpack-plugin
from ESlint. The plugin still works as expected but the only way to pass the error is to disable ESlint.
Actual Behavior
- I import the CopyWebpackPlugin into the
webpack.config.ts
with the import statement like so:
import CopyWebpackPlugin from 'copy-webpack-plugin'
;
- I am getting an error with no default export module available:
![Capture d’écran, le 2024-05-15 à 20 26 57](https://private-user-images.githubusercontent.com/25575134/330919025-083c34db-c1e5-4fa1-a1b8-e6effdbf6fcb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NDMyMDgsIm5iZiI6MTcxOTY0MjkwOCwicGF0aCI6Ii8yNTU3NTEzNC8zMzA5MTkwMjUtMDgzYzM0ZGItYzFlNS00ZmExLWExYjgtZTZlZmZkYmY2ZmNiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI5VDA2MzUwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZhMDBhMWU4MjY1NzRmZGUxY2MzNjM0OWIzNWNmNGVhZmVhYWNmNzA5MjA0ZDdjNDBlNDE3NWU0Mzc0Mjk2YjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.FeiRSif6ONu7sPVsQ5W579RfEKAHt26Wu5bDUIUSz6U)
It seems that this happens specifically when it is a Typescript config. Adding // eslint-disable-next-line import/default
resolves the issue.
Expected Behavior
I expected the import statement to work when being used in the Typescript config.
How Do We Reproduce?
Here is a detailed configuration of my webpack.config.ts
:
Please paste the results of npx webpack-cli info
here, and mention other relevant information
OS: macOS 14.0
CPU: (10) arm64 Apple M1 Pro
Memory: 113.81 MB / 16.00 GB
Binaries:
Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v15.0.0/bin/yarn
npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
Browsers:
Chrome: 124.0.6367.207
Safari: 17.0
Packages:
copy-webpack-plugin: ^12.0.2 => 12.0.2
css-loader: ^6.0.0 => 6.9.1
fork-ts-checker-webpack-plugin: ^7.2.13 => 7.3.0
node-loader: ^2.0.0 => 2.0.0
postcss-loader: ^7.3.3 => 7.3.4
ts-loader: ^9.2.2 => 9.5.1
webpack-dev-middleware: 5.3.4 => 5.3.4
alexander-akait commented
Please open an issue in eslint-plugin-import
, we can't fix it here, sorry