mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-02 22:17:18 +01:00
fix type errors
This commit is contained in:
@@ -68,9 +68,9 @@ export default function App() {
|
||||
addDocument(data)
|
||||
setPdfIsLoading(false)
|
||||
setPdfUrl(url)
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
setPdfIsLoading(false)
|
||||
setPdfError(error.message)
|
||||
setPdfError(error?.message || 'Unknown error')
|
||||
setPdfUrl(null)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ async function generateDoc(id: string): Promise<void> {
|
||||
const { stdout } = await execPromise(cmd, options)
|
||||
stdout.length && console.log('stdout:', stdout)
|
||||
console.log(`PDF ${id} generated`)
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error.stdout)
|
||||
console.error(error.toString())
|
||||
throw new Error(error.message)
|
||||
|
||||
@@ -33,7 +33,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
await renderer(id, texDoc)
|
||||
const storeData = { ...templateData, id, created: new Date().toISOString(), template: templateName }
|
||||
res.status(200).json({ id: id, data: storeData })
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error('Error:', err, 'for', req.url)
|
||||
res.status(500).json({ error: err.toString() })
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"lib": ["dom", "es2017"],
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2017"
|
||||
],
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"noEmit": true,
|
||||
@@ -16,8 +19,14 @@
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"target": "esnext"
|
||||
"target": "esnext",
|
||||
"incremental": true
|
||||
},
|
||||
"exclude": ["node_modules"],
|
||||
"include": ["**/*.ts", "**/*.tsx"]
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
],
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user