#Can't find variable: document
1 messages · Page 1 of 1 (latest)
Try this; https://bun.sh/docs/typescript#dom-types
the I am referring to the above doc and it throws an error, given in the screenshot.
My tsconfig.json file is
{
"compilerOptions": {
"lib": ["esnext", "dom"],
"module": "esnext",
"target": "esnext",
// if TS 5.x+
"moduleResolution": "bundler",
"noEmit": true,
"allowImportingTsExtensions": true,
"moduleDetection": "force",
// best practices
"strict": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"composite": true,
"downlevelIteration": true,
"allowSyntheticDefaultImports": true,
"allowJs": true,
"types": [
"bun-types", // add Bun global
"@types/web"
]
}
}
Is there any issue in configuration? Please help