-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
Package + Version
-
@sentry/browser -
@sentry/node -
raven-js -
raven-node(raven for node) - other:
Version:
4.0.0-rc.2
Description
Perhaps I've not correctly configured my TypeScript environment or something, but I cannot seem to successfully run tsc --build with @sentry/node, getting the following errors:
node_modules/@sentry/node/dist/handlers.d.ts:2:49 - error TS2304: Cannot find name 'Request'.
2 export declare function requestHandler(): (req: Request, res: Response, next: () => void) => void;
~~~~~~~
node_modules/@sentry/node/dist/handlers.d.ts:2:63 - error TS2304: Cannot find name 'Response'.
2 export declare function requestHandler(): (req: Request, res: Response, next: () => void) => void;
~~~~~~~~
node_modules/@sentry/node/dist/handlers.d.ts:13:71 - error TS2304: Cannot find name 'Request'.
13 export declare function errorHandler(): (error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void;
~~~~~~~
node_modules/@sentry/node/dist/handlers.d.ts:13:85 - error TS2304: Cannot find name 'Response'.
13 export declare function errorHandler(): (error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void;
~~~~~~~~
node_modules/@sentry/node/dist/transports/base.d.ts:8:53 - error TS2304: Cannot find name 'URL'.
8 request(options: http.RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
~~~
In case it is my TypeScript configuration, the contents of tsconfig.json is:
{
"compilerOptions": {
"module": "commonjs",
"target": "es2017",
"lib": [
"es2017"
],
"moduleResolution": "node",
"rootDir": "./",
"sourceMap": true,
"allowJs": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noImplicitThis": true,
"strictNullChecks": true,
"noImplicitReturns": true,
"preserveConstEnums": true,
"suppressImplicitAnyIndexErrors": true,
"forceConsistentCasingInFileNames": true,
"strict": true
},
"exclude": [
"node_modules",
"build",
"webpack"
],
"types": [
"typePatches"
]
}
And a simple use case:
import { init } from "@sentry/node";
init({
dsn: "..."
});
Metadata
Metadata
Assignees
Labels
No labels