-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Overview
When passing in an invalid YAML config via a Base64 string (might affect other methods also), the YAML validation error is not printed to the console. Instead only the JSON parsing error is shown. This makes it difficult to debug invalid configurations.
E.g. if passing in a YAML config which contains !env substitutions which have either undefined env vars or use variable names not starting with PS_ the following error is printed.
Error: Unexpected token 'r', "replicatio"... is not valid JSON
{"stack":"Error: Could not collect config using Base64 method. Caught exception: Error: Could not parse PowerSync config file content as JSON or YAML: SyntaxError: Unexpected token 'r', \"replicatio\"... is not valid JSON\n at CompoundConfigCollector.collectBaseConfig (file:///Users/stevenontong/Documents/platform_code/powersync/service/powersync-service/packages/service-core/dist/util/config/compound-config-collector.js:164:23)\n at async CompoundConfigCollector.collectConfig
(file:///Users/stevenontong/Documents/platform_code/powersync/service/powersync-service/packages/service-core/dist/util/config/compound-config-collector.js:27:28)\n at async startUnifiedRunner (file:///Users/stevenontong/Documents/platform_code/powersync/service/powersync-service/service/src/runners/unified-runner.ts:10:20)\n at async Command.<anonymous> (file:///Users/stevenontong/Documents/platform_code/powersync/service/powersync-service/packages/service-core/dist/entry/commands/start-action.js:12:9)\n at async Command.parseAsync (/Users/stevenontong/Documents/platform_code/powersync/service/powersync-
service/node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/command.js:1092:5)\n at async runProgram (file:///Users/stevenontong/Documents/platform_code/powersync/service/powersync-service/packages/service-core/dist/entry/cli-entry.js:31:17)"}
The service should not swallow the YAML validation errors.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers