Skip to content
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

Publish to Chromatic fails with error: Cannot find module 'clean-webpack-plugin' #867

Closed
TamarLebelCohen opened this issue Dec 4, 2023 · 4 comments
Labels
bug Classification: Something isn't working needs triage Tracking: Issue needs confirmation

Comments

@TamarLebelCohen
Copy link

Description:
Encountering a 'clean-webpack-plugin' module not found error while attempting to publish a library to Chromatic using 'chromaui/action@v1' in a GitHub Actions workflow. The issue arises during the webpack build process before the Chromatic publishing step.

Error Log:

`$ webpack
[webpack-cli] Failed to load '/home/runner/work/bionic-design/bionic-design/webpack.config.js' config
[webpack-cli] Error: Cannot find module 'clean-webpack-plugin'
Require stack:

  • /home/runner/work/bionic-design/bionic-design/webpack.config.js
  • /usr/local/lib/node_modules/webpack-cli/lib/webpack-cli.js
  • /usr/local/lib/node_modules/webpack-cli/lib/bootstrap.js
  • /usr/local/lib/node_modules/webpack-cli/bin/cli.js
  • /usr/local/lib/node_modules/webpack/bin/webpack.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object. (/home/runner/work/bionic-design/bionic-design/webpack.config.js:2:32)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/runner/work/bionic-design/bionic-design/webpack.config.js',
    '/usr/local/lib/node_modules/webpack-cli/lib/webpack-cli.js',
    '/usr/local/lib/node_modules/webpack-cli/lib/bootstrap.js',
    '/usr/local/lib/node_modules/webpack-cli/bin/cli.js',
    '/usr/local/lib/node_modules/webpack/bin/webpack.js'
    ]
    }
    error Command failed with exit code 2.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    error Command failed with exit code 2.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    Error: non-zero exit code`

Context:

'clean-webpack-plugin' is specified in the project's package.json.
The package is recognized in a previous step before the Chromatic publishing.
The workflow uses 'chromaui/action@v1' for Chromatic integration.
Expected Behavior:
The webpack build should successfully recognize and load the 'clean-webpack-plugin' module during the Chromatic publishing workflow.

Steps to Reproduce:

GitHub Actions workflow using 'chromaui/action@v1.'
Include Chromatic publishing step.
Ensure 'clean-webpack-plugin' is listed in package.json.
Run the workflow and observe the error during the webpack build.
Additional Information:
Workflow and relevant configuration files are available for further analysis upon request.

Thank you for your prompt attention to this matter.

Best regards,
Tamar Cohen

@TamarLebelCohen TamarLebelCohen added bug Classification: Something isn't working needs triage Tracking: Issue needs confirmation labels Dec 4, 2023
@Doron3
Copy link

Doron3 commented Dec 12, 2023

same problem

@galBionic
Copy link

same

@skitterm
Copy link
Member

Hi folks, does this issue still happen when using chromaui/action@latest instead of chromaui/action@v1? We've recently updated our CI documentation to recommend using @latest, along with a couple of other small changes to the example file that you may want to follow.

@paulelliott
Copy link
Member

This should be fixed. Please reopen if you feel this is still relevant for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Classification: Something isn't working needs triage Tracking: Issue needs confirmation
Projects
None yet
Development

No branches or pull requests

5 participants