-
Notifications
You must be signed in to change notification settings - Fork 662
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
Move @types/node from devDependencies to dependencies #514
Comments
I'm also getting this error |
Thanks for reporting! Can you share the contents of your |
This is what I have: {
"compilerOptions": {
"lib": ["es6", "es2015.promise", "dom"],
"module": "commonjs",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": false,
"outDir": "build",
"sourceMap": false,
"target": "es6",
"typeRoots" : ["./src/_shared/types", "./node_modules/@types"]
},
"include": [
"src/**/*.ts",
"spec/**/*.ts"
]
} |
I was able to reproduce this issue, except I could only do so using an old version of I figured out that the version of In this specific case, I feel that the solution is probably to just run While testing, I also found that our target version of
|
Thanks @clavin and @aoberoi ! I can confirm that adding the node types as dev dependency gets rid of this error. It is somewhat counter intuitive though, as if I understand correctly node version 6 and above is supported, but you must have types from 8 or later? This also makes developing against 6 or 7 more error prone, as you might use stuff that is not available in reality. This I think is a problem, as we run our code in Firebase Cloud Functions (Google Cloud Functions) and they are still on version 6. I just checked AWS Labmda too, and they support either 4 or 6. Would it be possible to express the typing some other way to properly support 6 and 7? |
I can definitely agree with the statement about the required In theory, as long as you compile your TypeScript sources ahead of time and run the generated JS output (which, on GCF and Lamda you should do as compilation on the server would be a waste of resources) then you won’t run into this type error, and your code should run fine (again, as you said, watch out for unimplemented APIs). Versions of node that don’t have Alas, I have no other solution for you except to use these newer node typings in the meantime while this issue is sorted out. As for resolving this issue with the package, it’s easy enough to fix the original problem by giving the interface CallbackifyType {
// ...
}
export const callbackify: CallbackifyType = // ... This, however, doesn’t resolve the issue I was getting with using the |
One solution I can think of would be to move the Right now, I prefer this solution over copying the type from the |
There is some guidance regarding when to put a The advice I see there is to put I think its worth implementing the solution in my previous comment because at worst, the consumer of the package will end up with 2 versions of |
Description
My typescript project does not compile after upgrading to 4.0.1.
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
@slack/client
version: 4.0.1node version: v8.9.1
OS version(s): Mac High Sierra
Steps to reproduce:
@slack/client
to project usingnpm install @slack/client
Expected result:
The project compiles
Actual result:
node_modules/@slack/client/dist/util.d.ts(29,47): error TS2339: Property 'callbackify' does not exist on type 'typeof "util"'.
Looking at the generated util.d.ts file, it contains
export declare const callbackify: typeof util.callbackify;
This should probably be more complex type?
I'm trying to compile using typescript 2.7.2 by
running node_modules/typescript/bin/tsc
The text was updated successfully, but these errors were encountered: