openedx / openedx/edx-ora2

npm run build is broken

Open
#2,322 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
65
Forks
218
PR merge metrics
No merged PRs in 30d

Description

The webpack build build fails at:

ERROR in ./node_modules/@openedx/paragon/dist/Card/fallback-default.png
Module build failed (from ./node_modules/image-webpack-loader/index.js):
Error
    at ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
 @ ./node_modules/@openedx/paragon/dist/Card/CardImageCap.js 55:0-56 102:28-46 171:15-33
 @ ./node_modules/@openedx/paragon/dist/Card/index.js
 @ ./node_modules/@openedx/paragon/dist/index.js
 @ ./openassessment/xblock/static/js/src/lms/containers/WaitingStepDetailsContainer.jsx
 @ ./openassessment/xblock/static/js/src/lms/oa_staff_waiting_step.jsx
 @ ./openassessment/xblock/static/js/src/lms/oa_base.js
 @ ./openassessment/xblock/static/js/src/lms_index.js

I can fix the issue with:

diff --git a/webpack.prod.config.js b/webpack.prod.config.js
index 1ac5c9e95..f235c3310 100644
--- a/webpack.prod.config.js
+++ b/webpack.prod.config.js
@@ -18,6 +18,10 @@ let config = createConfig('webpack-prod');
 const modifiedCssRule = {
   module: {
     rules: [
+      {
+        test: /\.png$/,
+        loader: 'file-loader',
+      },
       // This babel-loader config is pulled from frontend-build@13.0.4
       // When we update frontend-build to above that version, this section
       // can be removed and we can fallback to the implementation upstream.

But unsure if the issue needs to be fixed here, in paragon, or in the common base config from openedx/frontend-build.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing npm run build and inspect webpack.prod.config.js around modifiedCssRule; trace the failing PNG through @openedx/paragon and the openedx/frontend-build common config. Done means the repository build completes without the image-webpack-loader error, with the fix placed in the appropriate configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.