Rocket.Chat.Apps-engine
Rocket.Chat.Apps-engine copied to clipboard
Compiling to broken code
I'm running rc-apps deploy on the latest release.
It seems to compile my valid typescript to some broken code. It looks like it cannot resolve the import properly.
I reverted rc-apps to 1.4.0 (on which I had this code successfully working 4 months ago) and the same thing happened. Maybe it has something to do with the typescript version I'm using (3.6.3)?
import {IConfigurationExtend, IEnvironmentRead} from '@rocket.chat/apps-engine/definition/accessors';
import {App} from '@rocket.chat/apps-engine/definition/App';
import {RemindCommand} from './command/RemindCommand';
export class Reminder extends App {
protected async extendConfiguration(
configuration: IConfigurationExtend,
environmentRead: IEnvironmentRead,
): Promise<void> {
await configuration.slashCommands.provideSlashCommand(new RemindCommand());
}
}
I'm running this in a docker container:
FROM node:latest
RUN npm install -g typescript @rocket.chat/apps-cli
This is my directory structure, just to confirm to you that the RemindCommand.ts exists.

And my app.json
{
"id": "c839f5a6-65fa-4d17-b819-17d5c06f550f",
"version": "0.0.1",
"requiredApiVersion": "^1.4.0",
"iconFile": "res/icon.png",
"name": "reminder",
"nameSlug": "reminder",
"classFile": "src/Reminder.ts",
"description": "Set reminders for a user or channel with the /remind command."
}
All the CLI does it zips up the files, it doesn't actually compile anything to javascript and keeps it as TypeScript. @d-gubert any idea for what's going on?
I've never seen this happen 🤔
Can you check the zip file generated by the deploy command and validate that it has only typescript code?
The docker image you're using is solely for executing the CLI?
@d-gubert I can confirm that the files in the zip are identical to the source files.
Yes, I have this docker image so I don't have to install node and other dependencies on my machine. In a different container I run the rocketchat server, though that should not matter.
I made my repo public so you can have a look and see if you can reproduce this issue. https://github.com/dbrekelmans/reminder-rc-app
This seems like a bug in the apps-engine to me since it the cli only zips the files. Would you like me to repost this issue there?
Hi @dbrekelmans , which apps-engine version do you use?
Hi @lolimay, in my package.json I put ^1.6.0, so the latest version.
You can use my repo to reproduce this issue: https://github.com/dbrekelmans/reminder-rc-app