Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggests that tsconfig.json is incorrect only when SyntaxError is caught #6160

Merged
merged 3 commits into from
Apr 4, 2019

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Jan 9, 2019

Otherwise I get i.e. such output;

Could not parse tsconfig.json. Please make sure it contains syntactically correct JSON.
Details: tsconfig.json(19,12): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.

Which is misleading - especially taking into account that info about incorrect JSON is written in bold

Copy link

@jenbuzz jenbuzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok but in what case would this an error that is not related to syntax. What did your tsconfig look like?

Looks like a test is now failing

@Andarist
Copy link
Contributor Author

Seems ok but in what case would this an error that is not related to syntax. What did your tsconfig look like?

I've pasted in the error I've received - as you might see it's not related to the JSON syntax, but rather purely about misconfiguring TS.

Looks like a test is now failing

Seems unrelated, I'll try rebasing.

@stale
Copy link

stale bot commented Feb 17, 2019

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Feb 17, 2019
@Andarist
Copy link
Contributor Author

BUMP for stale bot

@stale stale bot removed the stale label Feb 17, 2019
@stale
Copy link

stale bot commented Mar 19, 2019

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Mar 19, 2019
)
);
}

console.error(e && e.message ? `Details: ${e.message}` : '');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop "Details: " from the start of the error message because it doesn't really make sense in the case of non-syntax error.

@stale stale bot removed the stale label Mar 21, 2019
@iansu iansu self-assigned this Mar 21, 2019
@iansu iansu added this to the 3.0 milestone Mar 21, 2019
);
}

console.error(e && e.message ? `${e.message}` : '');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to console.error() again even if it's a SyntaxError?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. console.log is probably fine here.

@iansu iansu closed this Apr 4, 2019
@iansu iansu reopened this Apr 4, 2019
@iansu iansu merged commit 42640df into facebook:master Apr 4, 2019
@lock lock bot locked and limited conversation to collaborators Apr 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants