GetStream/stream-chat-angular

Unable to run example apps

elongberg opened this issue · 3 comments

I'm unable to get the Sample App or Customization Examples running. Tried a few different setups, all with fresh installs of node v16.20.2 and latest version of this repo.

  • Windows: seems to not be intended to run here (package.json scripts include e.g. rm command)
  • WSL: This does somewhat work (have to jump through hoops for the host ip address), but trying the start:customizations-example script throws errors unless I separately run npm install stream-chat-angular (doesn't seem to want to use the local version). Even then, there are related issues that I haven't bothered working through.
  • Mac (latest): chokes up with the below error when trying to run the initial npm install. Attempting to remove the offending puppeteer from package.json just leads to other errors.
image

There are also other warnings like the below which make me wonder if node 16 is the version intended for running this, or should I try on node 14?
image

I'll have to check running the apps on Windows.

But as for macOS: I've cloned the repository and followed the steps in the Readme using Node v16.20.2 and both the sample app and the customizations example started without any problems.

The error seems to be happening when installing Puppeteer, I've checked and couldn't find a relevant error in their GH repository, but the error does look like it could be a Node.js issue (maybe the reason I can't reproduce it is because the script doesn't run for me because something is already installed on my computer, I'm not sure). We do recommend using Node 16 to start the example apps, and no one has reported this issue before, but I'd suggest trying one of these workarounds:

  • Remove puppeteer from the package.json
  • Use Node v14

Got everything running on macOS now, but had to jump through the below hoops to do it. I suspect most of this would be fixed for future users if the library could be updated to newer versions of node and other dependencies.

I've found that node 14 is required to first install the dependencies, but after that node 16 works just fine. It looks like this version of puppeteer's script for installing chromium doesn't work on newer node versions (probably need to update puppeteer for that).

After that, trying to run the script start:customizations-example just gave a bunch of errors like this (same thing happened on WSL)
image

Instead I tried the start script, which gave a lot of warnings and then this out of memory error
image
This was fixed by giving node more memory (changed the start script to NODE_OPTIONS=--max_old_space_size=4096 ng serve sample-app).

At that point the start script worked great (and I found I could remove the extra memory allocation, seemed to only be needed for some first-time compilation). I also then tried the other script start:customizations-example and it worked this time too. My guess: start runs prestart which includes ng build, that should also be added to prestart:customizations-example.

Thanks for the feedback. Unfortunately the Node version we use is dictated by Angular, which dictates the minimum supported Angular version. In any case, I'll do some testing to make sure we have a working readme for macOS and Windows as well.