Skip to content

Commit 3135ec6

Browse files
authored
Merge pull request #5196 from Shopify/shauns/01-15-fix_error_handler_for_invalid_toml_files
Fix error handler for invalid TOML files
2 parents 271e28c + 4969c1f commit 3135ec6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/small-guests-brake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/app': patch
3+
---
4+
5+
Better error message for certain types of invalid app TOML files

packages/app/src/cli/models/app/loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export async function loadConfigurationFileContent(
8282
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8383
} catch (err: any) {
8484
// TOML errors have line, pos and col properties
85-
if (err.line && err.pos && err.col) {
85+
if (err.line !== undefined && err.pos !== undefined && err.col !== undefined) {
8686
return abortOrReport(
8787
outputContent`Fix the following error in ${outputToken.path(filepath)}:\n${err.message}`,
8888
{},

0 commit comments

Comments
 (0)