Web app of accelerators doesn't work

Hi guys! I’m trying to replicate the first Blues accelerator for the Indoor floor-level tracker, but I’m having a problem connecting to the web app. I followed all the steps but when I start the application I only have the message: An internal error occurred. If this problem persists, contact Blues Support. And in terminal, I have the next message:

code: 'ERR_HTTP_HEADERS_SENT'
}
error - (api)/src/pages/api/device-trackers.ts (41:14) @ deviceTrackersHandler
ErrorWithCause: Could not fetch device tracker data: 
  39 |     res.status(StatusCodes.INTERNAL_SERVER_ERROR);
  40 |     res.json({ err: ReasonPhrases.INTERNAL_SERVER_ERROR });
> 41 |     const e = new ErrorWithCause("Could not fetch device tracker data: ", {
     |              ^
  42 |       cause,
  43 |     });
  44 |     serverLogError(e);
error - uncaughtException: Error [ERR_STREAM_WRITE_AFTER_END]: write after end

The Swan doesn’t work either because I have a loop with the following message: Waiting for Environment Variables from the Notecard

I’m not sure what I’m doing wrong, can someone help me?

Hey @haerazogu,

Welcome to the Blues community, and sorry you ran into issues here. That error indicates that the project was unable to connect to the Notehub API and read device data.

To start, can you make sure you have a .env file in the root of your project and that it has a HUB_AUTH_TOKEN, HUB_PROJECT_UID, and HUB_FLEET_ID in it as spelled out here https://github.com/blues/app-accelerators/tree/main/01-indoor-floor-level-tracker/web-app#configuration-environment-variables.

Here’s what my file looks like just so you can get a rough sense whether yours looks correct.

Thanks,
TJ

Thank you so much @tjvantoll, yes, that was it, I had a noobie error :smile:

2 Likes