-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
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
Module '"cron"' declares 'CronJob' locally #906
Comments
update 2: my bad, I was actually getting a different error which was a local configuration issue. I can't duplicate this. where are you getting the error, inside a .ts file that you're trying to compile? is the error in a code editor or TypeScript compiler output? or something else? |
The error appears in both the editor and the compiler output. EditorOutputUpdate to cron/dist everything is finepackage.json{
"devDependencies": {
"@types/mongoose": "^5.11.97",
"@types/winston": "^2.4.4",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"copyfiles": "^2.4.1",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.6.3"
},
"dependencies": {
"@types/luxon": "^3.4.2",
"@types/radius": "^0.0.33",
"cron": "^3.1.8",
"dotenv": "^16.4.5",
"luxon": "^3.5.0",
"mongoose": "^8.7.3",
"mongoose-paginate-v2": "^1.8.5",
"radius": "^1.1.4",
"winston": "^3.15.0"
}
} tsconfig.json{
"compilerOptions": {
"target": "ES2016",
"module": "CommonJS",
"rootDir": "./src",
"outDir": "./dist",
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"noImplicitAny": false,
"baseUrl": "./src",
"removeComments": true,
"sourceMap": false
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist"]
} |
Thanks for the report, it should be fixed by #908. This issue will be updated once the PR is merged and a new version is released. Feel free to re-open it then if the problem is still occurring on the latest version. |
## Description See related issue. ## Related Issue #906 ## Motivation and Context ## How Has This Been Tested? Untested, just followed the TypeScript doc: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package ## Screenshots (if appropriate): ## Types of changes - [X] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: - [X] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [X] All new and existing tests passed. - [ ] If my change introduces a breaking change, I have added a `!` after the type/scope in the title (see the Conventional Commits standard).
🎉 This PR is included in version 3.1.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
According to the documentation below, to perform the import in the following way:
However, an error occurs that results in:
To perform the correct import in TypeScript, use:
Expected Behavior
Actual Behavior
Possible Fix
No response
Steps to Reproduce
Context
no
Your Environment
cron
version: 3.1.8The text was updated successfully, but these errors were encountered: