Trying to follow "Build your own IDE/Tool" example, page wont load in browser

I tried to follow the Build your own IDE/Tool guide to get Theia running. It builds and the server starts, but when I load it in a browser I get a blank page with this error in the console:

Uncaught TypeError: ThemeService.get is not a function

I’ve tried a few things, can’t figure out what’s wrong. My package.json:

{
  "private": true,
  "theia": {
    "target": "browser"
  },
  "dependencies": {
    "@theia/callhierarchy": "next",
    "@theia/file-search": "next",
    "@theia/git": "next",
    "@theia/markers": "next",
    "@theia/messages": "next",
    "@theia/navigator": "next",
    "@theia/outline-view": "next",
    "@theia/plugin-ext-vscode": "next",
    "@theia/preferences": "next",
    "@theia/preview": "next",
    "@theia/search-in-workspace": "next",
    "@theia/terminal": "next"
  },
  "devDependencies": {
    "@theia/cli": "next"
  },
  "theiaPluginsDir": "/usr/src/webide/plugins",
  "theiaPlugins": {
    "vscode-builtin-extensions-pack": "https://open-vsx.org/api/eclipse-theia/builtin-extension-pack/1.53.2/file/eclipse-theia.builtin-extension-pack-1.53.2.vsix"
  },
  "theiaPluginsExcludeIds": [
    "vscode.extension-editing",
    "vscode.github",
    "vscode.microsoft-authentication",
    "ms-vscode.js-debug-companion"
  ]
}

And my Containerfile:

FROM debian:stable
ENV NODE_VERSION=v16.15.1
ENV NODE_HASH=f78a49c0c9c2f546c3a44eb434c49a852125441422a1bcfc433dedc58d6a241c

RUN apt-get update && apt-get install -y wget make gcc pkg-config build-essential git libsecret-1-dev python3 golang-any python3 

RUN wget --quiet -O /tmp/node.tar.gz "https://nodejs.org/download/release/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64.tar.gz" && echo "${NODE_HASH}  /tmp/node.tar.gz" | sha256sum --check --status && tar xf /tmp/node.tar.gz && mv "node-${NODE_VERSION}-linux-x64/" /usr/node && rm /tmp/node.tar.gz
RUN ln -s /usr/node/bin/* /usr/bin
RUN corepack enable

RUN yarn global add @theia/cli --prefix /usr/local
ADD package.json /usr/src/webide/package.json
WORKDIR /usr/src/webide
RUN yarn
RUN theia build --mode development
RUN theia download:plugins

RUN useradd user
USER user

EXPOSE 3000

CMD ["theia", "start", "--hostname=0.0.0.0", "--port=3000", "--plugins=local-dir:/usr/src/webide/plugins"]

Maybe there’s something obvious that I’ve missed? I’m not really sure how to proceed.

Hi @ooo,

You are likely running into an error due to mismatched next versions of Theia packages. Can you share a repository for that or your yarn.lock file? We’ve removed the ThemeService.get function in a recent PR, but I assume the code generated by your version of the @theia/cli dependency still calls that function.

In general, please pin your versions of Theia packages to a specific version (such as 1.26.0). That should alleviate these kinds of issues.

Thanks, replacing all the nexts in my package.json with 1.26.0 seems to have helped. Was that documented somewhere that I’ve missed? I can’t help but feeling that a lot of documentation is missing or hiding somewhere that I haven’t found.

Given the scope of Theia, and the sheer amount of potential issues which might come up on it, no one really bothered to start documenting any issues/fixes. We usually have the discourse forum for that, as it is indexed by google, but it doesn’t catch everything.

The docs are always open for contributions :wink:

1 Like

gotcha, thanks!