We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47e53c2 commit 76714fbCopy full SHA for 76714fb
packages/vite-plugin-tempest/src/config.ts
@@ -52,7 +52,11 @@ async function loadConfigurationFromTempestConsole(): Promise<TempestViteConfigu
52
const { stdout } = await exec(`${php.value} ${TEMPEST_BIN} ${VITE_CONFIG_COMMAND}`)
53
const json = stdout.match(/\{.*\}/s)
54
55
- return JSON.parse(json?.[0] as string)
+ if (!json?.[0]) {
56
+ throw new Error('Could not find valid JSON in Tempest console output')
57
+ }
58
+
59
+ return JSON.parse(json[0])
60
} catch (error) {
61
console.error(
62
`[vite-plugin-tempest] Could not load configuration from [${php.value} ${TEMPEST_BIN} ${VITE_CONFIG_COMMAND}].`,
0 commit comments