-
Notifications
You must be signed in to change notification settings - Fork 346
backend-core: Cannot find type definition file for 'web'. ts(2688) #155
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
Comments
Ok fixed : I should add @types/web explicitly in my project, and remove "dom" in my tsconfig./lib entry. tsconfig.json: {
"compilerOptions": {
"lib": ["es2020"],
"target": "es2020",
"module": "CommonJS",
"sourceMap": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"baseUrl": "./src",
"outDir": "./build",
"forceConsistentCasingInFileNames": true,
"strict": true,
"esModuleInterop": true,
"strictNullChecks": true
},
"files": ["..."],
"include": ["src/**/*.ts"]
}
In the clerk mono-repo: @types/web is only added to the root of the mono-repo. I believe that it should be added to avoid same issue next time. In the frontend ( But ok, it compiles in both. Cheers. |
You saved our team some time today by posting your solution. Thank you! |
Thank you @nomocas! |
@nomocas Why was this issue closed? It's definitely a problem with this package, and I'm not sure why @types/web is required for a backend package. This is a bigger problem now because
We should keep the issue open so that the maintainers can track/fix it. |
Hello @no2chem, You are right, we should keep it open as it looks like nobody from clerk has seen it. |
We are working on a new version of |
Hello @SokratisVidros, After updating to @clerk/[email protected] (published yesterday), I still have several errors from missing dependencies. To reproduce : mkdir clerk-dependencies-error
cd clerk-dependencies-error
yarn init
yarn add @clerk/clerk-sdk-node
yarn add -D typescript tsc-watch You should have this in your {
"name": "clerk-dependencies-error",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@clerk/clerk-sdk-node": "^4.1.0"
},
"devDependencies": {
"tsc-watch": "^5.0.3",
"typescript": "^4.7.4"
}
} Then add an import clerk from "@clerk/clerk-sdk-node";
clerk.users
.getUserList({
emailAddress: ["[email protected]"],
})
.then((user) => {
console.log("user", user);
}); And also a {
"compilerOptions": {
"lib": ["es2020"],
"target": "es2020",
"module": "CommonJS",
"sourceMap": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"outDir": "./build",
"forceConsistentCasingInFileNames": true,
"strict": true,
"esModuleInterop": true,
"strictNullChecks": true
},
"include": ["**/*.ts"]
} Then in your console trigger: You should have 27 errors in your console. To fix them : And again : The compilation is then ok and of course, it says that it misses the CLERK_API_KEY env var (which is normal - if you provide one: it works). You should notice that I've fixed the All errors are linked to the provided tsconfig (as without providing one, it compiles, because it targets ES5 by default). But the tsconfig is a valid one. I hope this will help. Cheers. |
Hello everyone, The latest release includes lots of changes related to how we're handling internal dependencies. I've tested using the provided project and An important caveat to note however: the As always, we will be monitoring all these threads and any related issues such as:
You can install the latest by running @nomocas many thanks for the detailed explanation, it helped a lot :) |
Closing this one, but please feel free to ping us again if its needed :) |
Package + Version
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/clerk-expo
@clerk/backend-core
@clerk/clerk-sdk-node
@clerk/edge
Version:
Browser/OS
OSX 12.3
Nodejs 16.14.2
Typescript 4.6.3
Description
My backend project refuses to compile correctly.
tsconfig.json:
Compilation errors :
It comes from
/// <reference types="web" />
What is weird is that I do not have this issue in my nextjs frontend, with the same @clerk/backend-core version (same typescript, nodejs and @clerk/clerk-sdk-node).
But even in my nextjs project: when I open
Props.d.ts
orBase.d.ts
ortypes.d.ts
: it saysCannot find type definition file for 'web'.ts(2688)
. But it compiles.I tried several tsconfig changes. Nothing is working.
Any idea ?
Thanks.
The text was updated successfully, but these errors were encountered: