Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ FROM build-base AS labext-builder
# Copy manifests first so dependency install is cacheable between source edits.
WORKDIR /src/labextension
COPY labextension/.yarnrc.yml labextension/package.json labextension/pyproject.toml labextension/tsconfig.json labextension/install.json ./
# Yarn resolutions reference a local patch (license-webpack-plugin fix); it must
# exist before `jlpm install` resolves dependencies.
COPY labextension/.yarn ./.yarn
RUN jlpm install

COPY labextension/style ./style
Expand All @@ -52,10 +55,13 @@ WORKDIR /app

COPY --from=judge-builder /tmp/wheels /tmp/wheels
COPY --from=labext-builder /tmp/wheels /tmp/wheels
# torch >=2 treats NumPy as optional; without it `import torch` prints a
# "Failed to initialize NumPy" warning and tensor<->numpy interop is disabled.
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir \
torch --index-url https://download.pytorch.org/whl/cpu && \
pip install --no-cache-dir \
numpy \
/tmp/wheels/*.whl && \
rm -rf /tmp/wheels

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/dist/WebpackInnerModuleIterator.js b/dist/WebpackInnerModuleIterator.js
index 282271e7411aa6221e408befb4ecfb259edc5896..b55935ad110758a1be09c614fbc1fdc4ed97133e 100644
--- a/dist/WebpackInnerModuleIterator.js
+++ b/dist/WebpackInnerModuleIterator.js
@@ -58,7 +58,11 @@ var WebpackInnerModuleIterator = /** @class */ (function () {
return tokens[tokens.length - 1];
}
if (filename.indexOf('provide module') === 0) {
- return filename.split('=')[1].trim();
+ // Newer webpack emits self-provided Module Federation shares as
+ // "provide module (default) name@version|/path" (pipe separator, no '='),
+ // so split('=')[1] is undefined. Skip those instead of crashing on .trim().
+ var providedFile = filename.split('=')[1];
+ return providedFile == null ? null : providedFile.trim();
}
if (filename.indexOf('consume-shared-module') === 0) {
var tokens = filename.split('|');
3 changes: 3 additions & 0 deletions labextension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@
"jupyterlab": {
"extension": true,
"outputDir": "torchcode_labext/labextension"
},
"resolutions": {
"license-webpack-plugin@^4.0.2": "patch:license-webpack-plugin@npm%3A4.0.2#./.yarn/patches/license-webpack-plugin-npm-4.0.2-1e0a964980.patch"
}
}