Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !6160

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

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/Andarist/patch-1 into master 6 years ago
  • Overview 6
  • Commits 3
  • Pipelines 0
  • Changes 1

Created by: Andarist

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

Compare
  • master (base)

and
  • latest version
    fb6b6299
    3 commits, 2 years ago

1 file
+ 11
- 8

    Preferences

    File browser
    Compare changes
packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js
+ 11
- 8
  • View file @ fb6b6299

  • Edit in single-file editor

  • Open in Web IDE


@@ -172,14 +172,17 @@ function verifyTypeScriptSetup() {
parsedCompilerOptions = result.options;
} catch (e) {
console.error(
chalk.red.bold(
'Could not parse',
chalk.cyan('tsconfig.json') + '.',
'Please make sure it contains syntactically correct JSON.'
)
);
console.error(e && e.message ? `Details: ${e.message}` : '');
if (e && e.name === 'SyntaxError') {
console.error(
chalk.red.bold(
'Could not parse',
chalk.cyan('tsconfig.json') + '.',
'Please make sure it contains syntactically correct JSON.'
)
);
}
console.log(e && e.message ? `${e.message}` : '');
process.exit(1);
}
0 Assignees
None
Assign to
0 Reviewers
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
Lock merge request
Unlocked
participants
Reference:
Source branch: github/fork/Andarist/patch-1