question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should not auto generate `tsconfig.json` for `js` project unexpectly.

See original GitHub issue

Is this a bug report?

No

Environment

npx: installed 1 in 12.203s
Path must be a string. Received undefined
C:\Users\zheng\AppData\Roaming\npm\node_modules\create-react-app\index.js

Environment Info:

  System:
    OS: Windows 10
    CPU: x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
  Binaries:
    Yarn: 1.13.0 - C:\Users\zheng\AppData\Roaming\npm\yarn.CMD
    npm: 6.8.0 - D:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 40.15063.674.0
    Internet Explorer: 11.0.15063.850
  npmPackages:
    react: ^16.8.3 => 16.8.3
    react-dom: ^16.8.3 => 16.8.3
    react-scripts: 2.1.5 => 2.1.5
  npmGlobalPackages:
    create-react-app: Not Found

Steps to Reproduce

  1. create a javascript project, and some source code like xxx.js.
  2. create a type declared file for it, like xxx.d.ts.

Now each time we start the project used react-scripts start, it would generate a tsconfig.json unexpectly.

Expected Behavior

We just want to used the d.ts to declared some complicated types for some code, which flow and jsdoc could not implements.

I tried removed the d.ts temporary and start the project, then I recovery the d.ts file, and everything works well. The whole problem is just that react-scripts start generate the tsconfig.json and throw It looks like you're trying to use TypeScript but do not have typescript installed. unexpectly, for I just want used typed declartion instead of used Typescript.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
iansucommented, Apr 18, 2019

For the time being we are going to exclude *.d.ts from this check. We might reconsider autogenerating tsconfig.json in the future.

0reactions
iansucommented, Apr 19, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I generate a tsconfig.json file? - Stack Overflow
json via the command line? I tried command tsc init , but this doesn't work. typescript.
Read more >
TSConfig Reference - Docs on every TSConfig option
json ' extension, which is a common practice in node projects. This includes generating a type for the import based on the static...
Read more >
Typescript does not resolve modules through tsconfig.json's ...
Typescript does not resolve modules through tsconfig.json's baseUrl ... Whenever I create a component and try to import a service like this:
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
Note that ESLint does not support ESM configuration at this time. ... ESLint's JSON files also allow JavaScript-style comments. package.json - create an ......
Read more >
Troubleshooting | Stryker Mutator
The root cause for this is that Jest doesn't support running in a hidden directory on windows, like StrykerJS does by default (the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found