We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[8/9] RUN nest build: #12 17.86 src/app.module.ts:4:32 - error TS2307: Cannot find module '@nestjs/schedule' or its corresponding type declarations. #12 17.86 #12 17.86 4 import { ScheduleModule } from '@nestjs/schedule'; #12 17.86 ~~~~~~~~~~~~~~~~~~ #12 17.86 src/app.service.ts:2:26 - error TS2307: Cannot find module '@nestjs/schedule' or its corresponding type declarations. #12 17.86 #12 17.86 2 import { Interval } from '@nestjs/schedule'; #12 17.86 ~~~~~~~~~~~~~~~~~~ #12 17.86 #12 17.87 Found 2 error(s). #12 17.87
https://github.com/nestjs/schedule.git
NODE_VERSION=16.14.0 APP_NAME=nestjs-api APP_VERSION=0.0.7-rc.0 NODE_ENV=production APP_PORT=3000
version: '3.8'
services: node: container_name: ${APP_NAME} image: ${APP_NAME}:${APP_VERSION} build: context: . dockerfile: Dockerfile.dev command: npm run start:prod ports: - 3000:3000 restart: unless-stopped
FROM node:16.14.0
WORKDIR /usr/src/app
ARG NODE_ENV=production ENV NODE_ENV=${NODE_ENV}
COPY . /usr/src/app/
RUN npm config set loglevel http
RUN npm install @nestjs/cli -g
RUN npm install
RUN npm run build
COPY . .
CMD ["node", "dist/main"]
src/app.module.ts
import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service';
import { ScheduleModule } from '@nestjs/schedule';
@module({ // imports: [ScheduleModule.forRoot()], imports: [ScheduleModule.forRoot()], controllers: [AppController], providers: [AppService], }) export class AppModule {}
app.service.ts
import { Injectable } from '@nestjs/common'; import { Interval } from '@nestjs/schedule'; // import { Cron, CronExpression } from '@nestjs/schedule';
@Injectable() export class AppService { getHello(): string { return 'Hello World!'; }
// @Cron(CronExpression.EVERY_30_SECONDS) @interval(10000) handleCron() { console.log('Test'); } }
8.1.3
No response
The text was updated successfully, but these errors were encountered:
I refer to "https://docs.nestjs.com/techniques/task-scheduling" and properly installed @ nestjs/schedule and @ types/cron, but why I didn't find installed plug-ins will prompt
Sorry, something went wrong.
Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.
No branches or pull requests
Is there an existing issue for this?
Current behavior
Minimum reproduction code
https://github.com/nestjs/schedule.git
Steps to reproduce
NODE_VERSION=16.14.0
APP_NAME=nestjs-api
APP_VERSION=0.0.7-rc.0
NODE_ENV=production
APP_PORT=3000
version: '3.8'
services:
node:
container_name: ${APP_NAME}
image: ${APP_NAME}:${APP_VERSION}
build:
context: .
dockerfile: Dockerfile.dev
command: npm run start:prod
ports:
- 3000:3000
restart: unless-stopped
FROM node:16.14.0
WORKDIR /usr/src/app
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
COPY . /usr/src/app/
RUN npm config set loglevel http
npm install glob
RUN npm install @nestjs/cli -g
npm install dependency
RUN npm install
RUN npm run build
COPY . .
CMD ["node", "dist/main"]
Expected behavior
src/app.module.ts
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { ScheduleModule } from '@nestjs/schedule';
@module({
// imports: [ScheduleModule.forRoot()],
imports: [ScheduleModule.forRoot()],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
app.service.ts
import { Injectable } from '@nestjs/common';
import { Interval } from '@nestjs/schedule';
// import { Cron, CronExpression } from '@nestjs/schedule';
@Injectable()
export class AppService {
getHello(): string {
return 'Hello World!';
}
// @Cron(CronExpression.EVERY_30_SECONDS)
@interval(10000)
handleCron() {
console.log('Test');
}
}
Package version
8.1.3
NestJS version
No response
Node.js version
No response
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: