Commit 6bc2550c authored by Tim Neutkens's avatar Tim Neutkens

Development: Don't block on TypeScript validation

parent e5afc390
...@@ -344,7 +344,7 @@ async function startWatcher( ...@@ -344,7 +344,7 @@ async function startWatcher(
}, },
}) })
const fileWatchTimes = new Map() const fileWatchTimes = new Map()
let enabledTypeScript = await verifyTypeScript(opts) let enabledTypeScript: Promise<boolean> = verifyTypeScript(opts)
let previousClientRouterFilters: any let previousClientRouterFilters: any
let previousConflictingPagePaths: Set<string> = new Set() let previousConflictingPagePaths: Set<string> = new Set()
...@@ -411,7 +411,7 @@ async function startWatcher( ...@@ -411,7 +411,7 @@ async function startWatcher(
if (tsconfigPaths.includes(fileName)) { if (tsconfigPaths.includes(fileName)) {
if (fileName.endsWith('tsconfig.json')) { if (fileName.endsWith('tsconfig.json')) {
enabledTypeScript = true enabledTypeScript = Promise.resolve(true)
} }
if (watchTimeChange) { if (watchTimeChange) {
tsconfigChange = true tsconfigChange = true
...@@ -487,7 +487,7 @@ async function startWatcher( ...@@ -487,7 +487,7 @@ async function startWatcher(
} }
if (fileName.endsWith('.ts') || fileName.endsWith('.tsx')) { if (fileName.endsWith('.ts') || fileName.endsWith('.tsx')) {
enabledTypeScript = true enabledTypeScript = Promise.resolve(true)
} }
if (!(isAppPath || isPagePath)) { if (!(isAppPath || isPagePath)) {
...@@ -1054,9 +1054,13 @@ async function startWatcher( ...@@ -1054,9 +1054,13 @@ async function startWatcher(
} }
prevSortedRoutes = sortedRoutes prevSortedRoutes = sortedRoutes
if (enabledTypeScript) { enabledTypeScript
.then(async (enabled) => {
if (!enabled) {
return
}
// Using === false to make the check clearer. // Using === false to make the check clearer.
if (typescriptStatusFromLastAggregation === false) { if ((await typescriptStatusFromLastAggregation) === false) {
// we tolerate the error here as this is best effort // we tolerate the error here as this is best effort
// and the manual install command will be shown // and the manual install command will be shown
await verifyTypeScript(opts) await verifyTypeScript(opts)
...@@ -1116,7 +1120,10 @@ async function startWatcher( ...@@ -1116,7 +1120,10 @@ async function startWatcher(
opts.nextConfig opts.nextConfig
) )
await writeValidatorFile(routeTypesManifest, validatorFilePath) await writeValidatorFile(routeTypesManifest, validatorFilePath)
} })
.catch((err) => {
Log.warn('Failed to create TypeScript setup', err)
})
if (!resolved) { if (!resolved) {
resolve() resolve()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment