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

build(webpack): fix broken bundling - cannot find webpack.config.js #2357

Closed
petermetz opened this issue Mar 29, 2023 · 2 comments · Fixed by #2424
Closed

build(webpack): fix broken bundling - cannot find webpack.config.js #2357

petermetz opened this issue Mar 29, 2023 · 2 comments · Fixed by #2424
Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file good-first-issue Good for newcomers good-first-issue-400-expert Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. P1 Priority 1: Highest

Comments

@petermetz
Copy link
Contributor

Describe the bug

2023-03-28T22:41:19.4710948Z     "[webpack-cli] \x1B[31mError: Cannot find module '/home/runner/work/cacti/webpack.config.js'\n" +
2023-03-28T22:41:19.4711426Z     'Require stack:\n' +
2023-03-28T22:41:19.4712006Z     '- /home/runner/work/cacti/cacti/node_modules/webpack-cli/lib/webpack-cli.js\n' +
2023-03-28T22:41:19.4712679Z     '- /home/runner/work/cacti/cacti/node_modules/webpack-cli/lib/bootstrap.js\n' +
2023-03-28T22:41:19.4713326Z     '- /home/runner/work/cacti/cacti/node_modules/webpack-cli/bin/cli.js\n' +
2023-03-28T22:41:19.4713932Z     '- /home/runner/work/cacti/cacti/node_modules/webpack/bin/webpack.js\n' +
2023-03-28T22:41:19.4714607Z     '    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)\n' +
2023-03-28T22:41:19.4715262Z     '    at Function.Module._load (node:internal/modules/cjs/loader:778:27)\n' +
2023-03-28T22:41:19.4715874Z     '    at Module.require (node:internal/modules/cjs/loader:1005:19)\n' +
2023-03-28T22:41:19.4716603Z     '    at require (/home/runner/work/cacti/cacti/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)\n' +
2023-03-28T22:41:19.4717475Z     '    at WebpackCLI.tryRequireThenImport (/home/runner/work/cacti/cacti/node_modules/webpack-cli/lib/webpack-cli.js:32:22)\n' +
2023-03-28T22:41:19.4718324Z     '    at loadConfig (/home/runner/work/cacti/cacti/node_modules/webpack-cli/lib/webpack-cli.js:1536:38)\n' +
2023-03-28T22:41:19.4719068Z     '    at /home/runner/work/cacti/cacti/node_modules/webpack-cli/lib/webpack-cli.js:1589:42\n' +
2023-03-28T22:41:19.4719583Z     '    at Array.map (<anonymous>)\n' +
2023-03-28T22:41:19.4720316Z     '    at WebpackCLI.resolveConfig (/home/runner/work/cacti/cacti/node_modules/webpack-cli/lib/webpack-cli.js:1588:32)\n' +
2023-03-28T22:41:19.4721183Z     '    at WebpackCLI.createCompiler (/home/runner/work/cacti/cacti/node_modules/webpack-cli/lib/webpack-cli.js:2045:33) {\n' +
2023-03-28T22:41:19.4721759Z     "  code: 'MODULE_NOT_FOUND',\n" +
2023-03-28T22:41:19.4722122Z     '  requireStack: [\n' +
2023-03-28T22:41:19.4722711Z     "    '/home/runner/work/cacti/cacti/node_modules/webpack-cli/lib/webpack-cli.js',\n" +
2023-03-28T22:41:19.4723409Z     "    '/home/runner/work/cacti/cacti/node_modules/webpack-cli/lib/bootstrap.js',\n" +
2023-03-28T22:41:19.4724059Z     "    '/home/runner/work/cacti/cacti/node_modules/webpack-cli/bin/cli.js',\n" +
2023-03-28T22:41:19.4724686Z     "    '/home/runner/work/cacti/cacti/node_modules/webpack/bin/webpack.js'\n" +
2023-03-28T22:41:19.4725268Z     '  ]\n' +
2023-03-28T22:41:19.4725597Z     '}\x1B[39m\n' +
2023-03-28T22:41:19.4726006Z     'error Command failed with exit code 2.',

To Reproduce

yarn configure && yarn build:dev

Expected behavior

The script succeeds.

Logs/Stack traces

2023-03-28T19-59-36-cacti-webpack-build-crash.log

Cloud provider or hardware configuration:

Everywhere.

Operating system name, version, build:

Ubuntu 20.04

Hyperledger Cactus release version or commit (git rev-parse --short HEAD):

v1.2.0 and main

Hyperledger Cactus Plugins/Connectors Used

N/A

Additional context

The 1.2.0 auto-publishing failed in part due to this bug.

@petermetz petermetz added bug Something isn't working good-first-issue Good for newcomers dependencies Pull requests that update a dependency file Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. good-first-issue-400-expert P1 Priority 1: Highest labels Mar 29, 2023
@petermetz petermetz self-assigned this Mar 29, 2023
@petermetz petermetz changed the title build(webpack): fix broken build(webpack): fix broken bundling - cannot find webpack.config.js Mar 29, 2023
@deepto98
Copy link
Contributor

@petermetz Hi, I'm new to this project, and wanted to contribute. I was trying to get the supply chain example running, and encountered this webpack.config.js issue. As @charellesandig pointed out in the PR, the error comes from the examples/cactus-workshop-examples-2022-11-14 package. From what I understood, it had an incorrect webpack config path in its package.json file - ../../../webpack.config.js instead of ../../webpack.config.js, and also a missing /src/main/typescript/index.web.ts file. After adding these changes, the build dev passed for me. Is it okay if I send a PR with these changes?

@petermetz
Copy link
Contributor Author

@deepto98 Yes, thank you very much for this! I reviewed the PR Just now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file good-first-issue Good for newcomers good-first-issue-400-expert Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. P1 Priority 1: Highest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants