Build problems afte 1.16.0 release

Hey Theia community,

I’m having trouble building my IDE since yesterday’s (7-29-2021) release, even after rolling the theia version back to 1.15.0 from latest

Here is my minimal Dockerfile for the build:

FROM ubuntu:18.04

# install node, yarn, and other tools
RUN apt update -y && apt install vim curl gcc g++ make libsecret-1-dev libx11-dev libxkbfile-dev supervisor -y && \
    curl -fsSL https://deb.nodesource.com/setup_12.x | bash - && \
	apt install -y nodejs && \
	npm install --global yarn

# create a build directory for the IDE
RUN mkdir /theia
WORKDIR /theia

# build the IDE
COPY package.json .
RUN yarn --pure-lockfile && \
    NODE_OPTIONS="--max_old_space_size=4096" yarn theia build && \
    yarn theia download:plugins && \
    yarn --production && \
    yarn autoclean --init && \
    echo *.ts >> .yarnclean && \
    echo *.ts.map >> .yarnclean && \
    echo *.spec.* >> .yarnclean && \
    yarn autoclean --force && \
    yarn cache clean

and here is my minimal package.json:

{
    "private": true,
    "theia": {},
    "dependencies": {
        "@theia/editor-preview": "1.15.0",
        "@theia/file-search": "1.15.0",
        "@theia/markers": "1.15.0",
        "@theia/messages": "1.15.0",
        "@theia/monaco": "1.15.0",
        "@theia/navigator": "1.15.0",
        "@theia/outline-view": "1.15.0",
        "@theia/plugin-ext-vscode": "1.15.0",
        "@theia/preferences": "1.15.0",
        "@theia/preview": "1.15.0",
        "@theia/search-in-workspace": "1.15.0",
        "@theia/terminal": "1.15.0",
        "@theia/vsx-registry": "1.15.0",
        "@theia/task": "1.15.0",
        "@theia/plugin-dev": "1.15.0",
        "@theia/plugin-ext": "1.15.0"
    },
    "devDependencies": {
        "@theia/cli": "1.15.0"
    },
    "scripts": {
        "preinstall": "node-gyp install"
    },
    "theiaPluginsDir": "plugins",
    "theiaPlugins": {}
}

When yarn theia build is executed, it throws:

root@0094ce43dbe0:/theia# NODE_OPTIONS="--max_old_space_size=4096" yarn theia build
yarn run v1.22.11
$ /theia/node_modules/.bin/theia build
Failed to resolve module: filenamify

(node:1592) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of null
    at innerSourceIndex (/theia/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfCombinedSourceMap.js:173:50)
    at onMapping (/theia/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js:294:4)
    at readMappings (/theia/node_modules/webpack/node_modules/webpack-sources/lib/helpers/readMappings.js:61:6)
    at streamChunksOfSourceMapFinal (/theia/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js:309:2)
    at module.exports (/theia/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js:382:6)
    at streamChunksOfCombinedSourceMap (/theia/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunksOfCombinedSourceMap.js:54:9)
    at SourceMapSource.streamChunks (/theia/node_modules/webpack/node_modules/webpack-sources/lib/SourceMapSource.js:192:11)
    at module.exports (/theia/node_modules/webpack/node_modules/webpack-sources/lib/helpers/streamChunks.js:13:17)
    at ConcatSource.streamChunks (/theia/node_modules/webpack/node_modules/webpack-sources/lib/ConcatSource.js:112:55)
    at exports.getSourceAndMap (/theia/node_modules/webpack/node_modules/webpack-sources/lib/helpers/getFromStreamChunks.js:17:33)
    at ConcatSource.sourceAndMap (/theia/node_modules/webpack/node_modules/webpack-sources/lib/ConcatSource.js:94:10)
    at getTaskForFile (/theia/node_modules/webpack/lib/SourceMapDevToolPlugin.js:84:30)
    at /theia/node_modules/webpack/lib/SourceMapDevToolPlugin.js:272:22
    at /theia/node_modules/webpack/lib/Cache.js:93:5
    at Hook.eval [as callAsync] (eval at create (/theia/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
    at Cache.get (/theia/node_modules/webpack/lib/Cache.js:75:18)

(node:1592) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1592) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Done in 87.57s.

What is weird is that before the 1.16.0 release yesterday, my build’s were working fine with the latest tag. After the release, not even pinning to 1.15 or 1.14 seems to resolve the build. I’ve tried node version 12.x, 14.x, and 16.x as well.

Any insight would me much appreciated.

@TtheBC01 thank you for the discussion!

First, the dockerfile requires libsecret to be present in order to work as it is a dependency of keytar.
You can find examples here:

I have a pull-request pending to update the documentation for it https://github.com/eclipse-theia/theia/pull/9807.

The webpack issue should be resolved in 1.16.0. If you are using an older version of @theia dependencies (ex: 1.15.0) you might encounter issues if your pull a newer version of webpack. The solution would be to include a resolution as described in:

I hope this helps!

1 Like