Skip to content

Commit 6b94c88

Browse files
committed
Fix type issues with zone.js
1 parent 5230b34 commit 6b94c88

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/helpers/getDynamicTemplates.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const getAngularBuilder = ({ functionServerPath }) => javascript`
3737
`
3838

3939
const getServerlessTs = ({ projectName, siteRoot }) => javascript`
40+
/// <reference types="zone.js" />
4041
import 'zone.js/dist/zone-node'
4142
4243
import { join } from 'path'
@@ -117,15 +118,15 @@ const getServerlessTs = ({ projectName, siteRoot }) => javascript`
117118
}
118119
119120
const html: string = await new Promise((resolve, reject) => {
120-
// @ts-ignore
121121
Zone.current
122122
.fork({
123123
name: 'ServerlessErrorHandlerZone',
124124
onHandleError: (parentZoneDelegate, currentZone, targetZone, error) => {
125125
reject(error)
126+
return true; // needed for typescript, no idea what it does
126127
},
127128
})
128-
.runGuarded(function () {
129+
.runGuarded<Promise<string>>(function () {
129130
return engine.render(renderOptions)
130131
})
131132
.then(resolve)

0 commit comments

Comments
 (0)