I’m planning to customize the MFE header and footer on a Redwood installation, but as a preliminary step i’m only trying to get the tutor-mfe image build procedure to work, using the default frontend-component-header and frontend-component-footer repos.
This is my tutor plugin, which appears to be working as expected. running tutor images build mfe
results in this Dockerfile being generated, which also appears to be correct.
For the avoidance of any doubt, the substance of the tutor patches follows this pattern which i took from the tutor-mfe README page:
from tutor import hooks
hooks.Filters.ENV_PATCHES.add_item(
(
"mfe-dockerfile-post-npm-install-learning",
"""
RUN npm install '@edx/frontend-component-header@git+https://github.com/openedx/frontend-component-header.git'
RUN npm install '@edx/frontend-component-footer@git+https://github.com/openedx/frontend-component-footer.git'
"""
)
)
However, the build fails with the following console output.
The substantive portion of the console output is as follows:
=> ERROR [learning-prod 1/1] RUN npm run build 146.0s
------
> importing cache manifest from 090511222473.dkr.ecr.us-east-2.amazonaws.com/stepwisemath/openedx-mfe-v18:18.1.3-202410031826-cache:
------
------
> [learning-prod 1/1] RUN npm run build:
0.540
0.540 > @edx/frontend-app-learning@1.0.0-semantically-released build
0.540 > fedx-scripts webpack
0.540
0.598 Running with resolved config:
0.598 /openedx/app/webpack.prod.config.js
0.598
1.551 Browserslist: caniuse-lite is outdated. Please run:
1.551 npx update-browserslist-db@latest
1.551 Why you should do it regularly: https://github.com/browserslist/update-db#readme
145.0 Error parsing bundle asset "/openedx/app/dist/263.42ded56b1601a41b230c.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/app.e234fd2d5cbd1b64e9d6.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/700.527abebe778e1b7cf0ce.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/35.3fd162fd31dcc6663d4b.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/runtime.302438b30390ec69b1d3.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/106.474fa2bbc3e6fa7afd99.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/210.fb586582bddc7eea8376.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/974.558db8619526b7b79d0f.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/715.1c72fe5841ccb4b1b2b8.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/437.0222582e86be5b38c1d5.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/724.25aa06ea2b6b272a1efe.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/901.202fb5acec0d67427a89.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/28.bc7c2289d98e72d5a48c.js": no such file
145.0 Error parsing bundle asset "/openedx/app/dist/443.40af5685c505b9be8606.js": no such file
145.0
145.0 No bundles were parsed. Analyzer will show only original module sizes from stats file.
145.0
145.2 Webpack Bundle Analyzer saved report to /openedx/app/dist/report.html
145.7 assets by status 8.59 MiB [cached] 34 assets
145.7 Entrypoint app = runtime.302438b30390ec69b1d3.js 263.42ded56b1601a41b230c.js app.e234fd2d5cbd1b64e9d6.css app.e234fd2d5cbd1b64e9d6.js 21 auxiliary assets
145.7 orphan modules 7.71 MiB [orphan] 3597 modules
145.7 runtime modules 8.93 KiB 16 modules
145.7 cacheable modules 11.9 MiB (javascript) 498 KiB (css/mini-extract)
145.7 javascript modules 11.8 MiB
145.7 modules by path ./node_modules/ 9.48 MiB 1222 modules
145.7 modules by path ./src/ 2.31 MiB 29 modules
145.7 + 2 modules
145.7 json modules 115 KiB
145.7 modules by path ./node_modules/i18n-iso-countries/ 63.9 KiB 14 modules
145.7 modules by path ./node_modules/@cospired/i18n-iso-languages/ 20.2 KiB 6 modules
145.7 modules by path ./node_modules/cheerio/ 31.2 KiB 6 modules
145.7 css modules 498 KiB
145.7 modules by path ./node_modules/ 3.52 KiB 7 modules
145.7 modules by path ./src/ 495 KiB 2 modules
145.7
145.7 ERROR in ./node_modules/@openedx/frontend-slot-footer/dist/FooterSlot.js 9:54-95
145.7 Module not found: Error: Can't resolve '@edx/frontend-component-footer' in '/openedx/app/node_modules/@openedx/frontend-slot-footer/dist'
145.7 @ ./node_modules/@openedx/frontend-slot-footer/dist/index.js 7:41-64
145.7 @ ./src/generic/CourseAccessErrorPage.jsx 11:0-55 41:28-38 60:26-36
145.7 @ ./src/index.jsx 28:0-68 59:44-65
145.7
145.7 ERROR in ./src/course-home/goal-unsubscribe/GoalUnsubscribe.jsx 5:0-74
145.7 Module not found: Error: Can't resolve '@edx/frontend-component-header' in '/openedx/app/src/course-home/goal-unsubscribe'
145.7 @ ./src/course-home/goal-unsubscribe/index.jsx 1:0-48 2:15-30
145.7 @ ./src/index.jsx 19:0-61 49:44-59
145.7
145.7 ERROR in ./src/generic/CourseAccessErrorPage.jsx 7:0-74
145.7 Module not found: Error: Can't resolve '@edx/frontend-component-header' in '/openedx/app/src/generic'
145.7 @ ./src/index.jsx 28:0-68 59:44-65
145.7
145.7 ERROR in ./src/tab-page/TabPage.jsx 15:0-74
145.7 Module not found: Error: Can't resolve '@edx/frontend-component-header' in '/openedx/app/src/tab-page'
145.7 @ ./src/tab-page/index.js 2:0-47 2:0-47
145.7 @ ./src/index.jsx 21:0-42 64:44-56 74:44-56 84:44-56 94:44-56 104:44-56 115:44-56
145.7
145.7 ERROR in ./src/index.scss
145.7 Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
145.7 ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
145.7 Can't find stylesheet to import.
145.7 ╷
145.7 6 │ @import "~@edx/frontend-component-footer/dist/footer";
145.7 │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
145.7 ╵
145.7 src/index.scss 6:9 root stylesheet
145.7 at processResult (/openedx/app/node_modules/webpack/lib/NormalModule.js:764:19)
145.7 at /openedx/app/node_modules/webpack/lib/NormalModule.js:866:5
145.7 at /openedx/app/node_modules/loader-runner/lib/LoaderRunner.js:400:11
145.7 at /openedx/app/node_modules/loader-runner/lib/LoaderRunner.js:252:18
145.7 at context.callback (/openedx/app/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
145.7 at Object.loader (/openedx/app/node_modules/sass-loader/dist/index.js:63:5)
145.7 @ ./src/index.jsx 13:0-22
145.7
145.7 1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
145.7
145.7 4 errors have detailed information that is not shown.
145.7 Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
145.7
145.7 webpack 5.89.0 compiled with 6 errors in 139130 ms
------
Dockerfile:657
--------------------
655 | FROM learning-common AS learning-prod
656 | ENV NODE_ENV=production
657 | >>> RUN npm run build
658 |
659 |
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
Error: Command failed with status 1: docker buildx build --tag=090511222473.dkr.ecr.us-east-2.amazonaws.com/stepwisemath/openedx-mfe-v18:18.1.3-202410031826 --output=type=docker --cache-from=type=registry,ref=090511222473.dkr.ecr.us-east-2.amazonaws.com/stepwisemath/openedx-mfe-v18:18.1.3-202410031826-cache /home/ubuntu/.local/share/tutor/env/plugins/mfe/build/mfe
Can anyone explain what I’m doing wrong?