Skip to content

Commit d70fb1c

Browse files
committed
Suppress version.json warning in development environment
- Only show version file warning when running from dist (production) - Prevents noisy console output during development - The version.json file is generated during build and doesn't exist in src
1 parent 2760cd5 commit d70fb1c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/utils/versionUtils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ export function getVersionInfo(): VersionInfo {
2020
info['name'] = name;
2121
return info;
2222
} catch (error) {
23-
// eslint-disable-next-line no-console
24-
console.warn(`Failed to read version info: ${error}`);
23+
// Only warn if not in development (when running from src directory)
24+
const isDevelopment = import.meta.url.includes('/src/');
25+
if (!isDevelopment) {
26+
// eslint-disable-next-line no-console
27+
console.warn(`Failed to read version info: ${error}`);
28+
}
2529
return {
2630
name: name,
2731
version: '0.0.0',

0 commit comments

Comments
 (0)