Skip to content

Ensure empty extended config throws a diagnostic#9701

Merged
marcins merged 2 commits into
v2from
mszczepanski/fix-missing-config-diagnostic
May 7, 2024
Merged

Ensure empty extended config throws a diagnostic#9701
marcins merged 2 commits into
v2from
mszczepanski/fix-missing-config-diagnostic

Conversation

@marcins

@marcins marcins commented May 7, 2024

Copy link
Copy Markdown
Contributor

↪️ Pull Request

Small fix for a bug where an empty extended config file would result in an error message that didn't point to the root cause, this was because the error was an AssertionError and the error handling tried to process it as a Diagnostic.

💻 Examples

Before:

❯ parcel build
TypeError: Cannot read properties of undefined (reading 'message')
    at new ThrowableDiagnostic (/Users/mszczepanski/Work/atlassian/data-playground/node_modules/@parcel/diagnostic/lib/diagnostic.js:124:26)
[...]

After:

❯ parcel build
@parcel/core: packages/parcel-config-broken/index.json can't be empty

🚨 Test instructions

Extend an "empty" config file (i.e. index.json contains {})

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@marcins marcins requested a review from a team May 7, 2024 06:01
@marcins marcins enabled auto-merge May 7, 2024 06:49
@marcins marcins added this pull request to the merge queue May 7, 2024
Merged via the queue into v2 with commit 6dfeb9c May 7, 2024
@mischnic mischnic deleted the mszczepanski/fix-missing-config-diagnostic branch May 7, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants