openedx/credentials-themes

Webpack Build Failure

Closed this issue · 3 comments

Running make build locally should compile-and-build our CSS for the credentials-themes package. However, when attempting this locally, we noted the following error:

~/Documents/git/edx/src/credentials-themes   master  make build
/Users/username/Documents/git/edx/src/credentials-themes/node_modules/.bin/webpack --config webpack.config.js --progress
[webpack-cli] Failed to load '/Users/username/Documents/git/edx/src/credentials-themes/webpack.config.js' config
[webpack-cli] Error: Cannot find module 'glob'
Require stack:
- /Users/username/Documents/git/edx/src/credentials-themes/webpack.config.js
- /Users/username/Documents/git/edx/src/credentials-themes/node_modules/webpack-cli/lib/webpack-cli.js
- /Users/username/Documents/git/edx/src/credentials-themes/node_modules/webpack-cli/lib/bootstrap.js
- /Users/username/Documents/git/edx/src/credentials-themes/node_modules/webpack-cli/bin/cli.js
- /Users/username/Documents/git/edx/src/credentials-themes/node_modules/webpack/bin/webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/username/Documents/git/edx/src/credentials-themes/webpack.config.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/username/Documents/git/edx/src/credentials-themes/webpack.config.js',
    '/Users/username/Documents/git/edx/src/credentials-themes/node_modules/webpack-cli/lib/webpack-cli.js',
    '/Users/username/Documents/git/edx/src/credentials-themes/node_modules/webpack-cli/lib/bootstrap.js',
    '/Users/username/Documents/git/edx/src/credentials-themes/node_modules/webpack-cli/bin/cli.js',
    '/Users/username/Documents/git/edx/src/credentials-themes/node_modules/webpack/bin/webpack.js'
  ]
}
make: *** [build] Error 2

This issue made us realize we are not regularly checking in our updated CSS files generated by the build process.

We plan to resolve whatever issue is causing the webpack build to fail.

We also hope to be able to update our automation to see if there is a way to run the make build command when our Python Requirements job runs. This will allow us to keep our styles constantly updated in the credentials-theme package.

This will be addressed internally at 2U via https://2u-internal.atlassian.net/browse/APER-2065

Thank you for sharing the issue will follow up on the progress.

This was fixed as a part of upgrading Node from 12 to 16.