Skip to content

can't find .json in project file list despite tsc ok #1512

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

Closed
jfellus opened this issue Sep 30, 2019 · 6 comments
Closed

can't find .json in project file list despite tsc ok #1512

jfellus opened this issue Sep 30, 2019 · 6 comments

Comments

@jfellus
Copy link

jfellus commented Sep 30, 2019

I have a monorepo with the following hierarchy :

/tsconfig.json
/src/stuff.ts
/packages/adapters/tsconfig.json
/packages/adapters/src/stuff.ts
/packages/adapters/src/files/blabla.json

blabla.json is imported in some ts modules inside the adapters package.

/packages/adapters/tsconfig.json extends
/tsconfig.json

running tsc --build in any meaningful folder yields no error. Great !

but in atom I get
blabla.json is not in project file list. Projects must list all files ...

my blabla.json is properly included in /packages/adapters/tsconfig.json

/* /packages/adapters/tsconfig.json */
{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "outDir": "./lib",
    "rootDir": "./src",
    "composite": true
  },
  "include": ["./src/", "./src/files/*.json"]
}

/* /tsconfig.json */
{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "declaration": true,
    "composite": true,
    "removeComments": true,
    "strict": true,
    "noImplicitAny": false,
    "noImplicitThis": false,
    "baseUrl": "./",
    "paths": {
      "@blabla/adapters": ["./packages/adapters/src"],
    },
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "resolveJsonModule": true,
    "noFallthroughCasesInSwitch": true,
    "forceConsistentCasingInFileNames": true,
  },
  "exclude": ["node_modules", "**/*.spec.ts", "**/lib"]
}

should I set any option on the atom plugin to finally get the same behavior as a direct npx tsc --build ?

thanks !

@lierdakil
Copy link
Collaborator

Hi. Thanks for your report. Initial investigation suggest that this is probably an upstream problem, but I couldn't find a corresponding upstream issue during a cursory search.

The issue does not manifest if /packages/adapters/tsconfig.json is using files instead of include, but that's not a solution of course.

The issue only manifests on composite: true projects.

extends: ... doesn't affect the issue.

I have a vague suspicion that microsoft/TypeScript#27844 might have missed something in the tsserver code.

There are reports of this happening in VS Code (f.ex. TypeStrong/ts-loader#905 (comment)). Not sure how up-to-date those are though.

As a workaround, you can add 6307 to 'Ignore Diagnostics' package setting -- that will suppress the error message. As far as I can tell, it affects nothing else.

@lierdakil
Copy link
Collaborator

I've created an upstream issue with minimal repro. Hopefully they fix it eventually. microsoft/TypeScript#33827

@jfellus
Copy link
Author

jfellus commented Oct 7, 2019

thanks a lot !
ignoring will make it for me
Still interested in knowing if its a bug on TSServer side ;-)

@lierdakil
Copy link
Collaborator

lierdakil commented Oct 26, 2019

Issue reportedly fixed upstream, the fix should eventually find its way into TypeScript 3.7.something release. 3.7.1 if we're lucky. I think it's safe to close this.

@nscozzaro
Copy link

I'm still getting this problem, in PyCharm with TypeScript version 3.7.3

image

@lierdakil
Copy link
Collaborator

@nscozzaro so...

PyCharm

Why are you reporting this here again?

But yeah, the upstream fix is still unpublished as of yet. It's in master branch, but apparently didn't get into release-3.7 branch. You can pester upstream if you think it should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants