arena icon indicating copy to clipboard operation
arena copied to clipboard

Views directory is pointing to the wrong place

Open olliechick opened this issue 4 years ago • 1 comments

I am running Arena as a middleware in a Nest app. When I run it and try to open the URL I have set it to, it raises this error. How do I fix this?

Failed to lookup view "dashboard/templates/queueList" in views directory "[my-repo]\dist\apps\bullmq-queue/views" +96993ms
Error: Failed to lookup view "dashboard/templates/queueList" in views directory "[my-repo]\dist\apps\bullmq-queue/views"
    at Function.render ([my-repo]\dist\apps\bullmq-queue\webpack:\apps\bullmq-queue\node_modules\express\lib\application.js:580:1)
    at ServerResponse.render ([my-repo]\dist\apps\bullmq-queue\webpack:\apps\bullmq-queue\node_modules\express\lib\response.js:1012:1)
    at handler ([my-repo]\dist\apps\bullmq-queue\webpack:\apps\bullmq-queue\node_modules\bull-arena\src\server\views\dashboard\queueList.js:6:1)
    at Layer.handle [as handle_request] ([my-repo]\dist\apps\bullmq-queue\webpack:\apps\bullmq-queue\node_modules\express\lib\router\layer.js:95:1)
    at next ([my-repo]\dist\apps\bullmq-queue\webpack:\apps\bullmq-queue\node_modules\express\lib\router\route.js:137:1)
    at Route.dispatch ([my-repo]\dist\apps\bullmq-queue\webpack:\apps\bullmq-queue\node_modules\express\lib\router\route.js:112:1)
    at Layer.handle [as handle_request] ([my-repo]\dist\apps\bullmq-queue\webpack:\apps\bullmq-queue\node_modules\express\lib\router\layer.js:95:1)
    at [my-repo]\dist\apps\bullmq-queue\webpack:\apps\bullmq-queue\node_modules\express\lib\router\index.js:281:1
    at Function.process_params ([my-repo]\dist\apps\bullmq-queue\webpack:\apps\bullmq-queue\node_modules\express\lib\router\index.js:335:1)
    at next ([my-repo]\dist\apps\bullmq-queue\webpack:\apps\bullmq-queue\node_modules\express\lib\router\index.js:275:1)

My main.ts looks like this:

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

async function bootstrap() {
	const app = await NestFactory.create(AppModule);
	const port = 3005;
	await app.listen(port);
}
bootstrap();

and app.module.ts looks like this:

import { MiddlewareConsumer, Module } from '@nestjs/common';
import Arena from 'bull-arena';
import { FlowProducer, Queue } from 'bullmq';

@Module({})
export class AppModule {
	configure(consumer: MiddlewareConsumer) {
		const arena = Arena(
			{
				BullMQ: Queue,
				FlowBullMQ: FlowProducer,
				queues: [
					{
						type: 'bullmq',

						// Name of the bullmq queue, this name must match up exactly with what you've defined in bullmq.
						name: 'queue_name',

						// Hostname or queue prefix, you can put whatever you want.
						hostId: 'worker',

						// Redis auth.
						redis: {
							host: '127.0.0.1',
							port: 6379,
							password: ''
						}
					}
				],
				flows: [
					{
						type: 'bullmq',

						// Name of the bullmq flow connection, this name helps to identify different connections.
						name: 'testConnection',

						// Hostname, you can put whatever you want.
						hostId: 'Flow',

						// Redis auth.
						redis: {
							host: '127.0.0.1',
							port: 6379,
							password: ''
						}
					}
				]
			},
			{ disableListen: true }
		);
		consumer.apply(arena).forRoutes('/system/queues');
	}
}

olliechick avatar Jun 08 '21 06:06 olliechick

I'm not sure what's happening there. Try checking out this project and running the bullmq example in directory https://github.com/bee-queue/arena/tree/master/example.

bradvogel avatar Jun 08 '21 15:06 bradvogel