Skip to content

resolveJsonModule doesn't work with composite projects and import from node_modules #30785

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
mikea opened this issue Apr 5, 2019 · 7 comments
Assignees
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@mikea
Copy link

mikea commented Apr 5, 2019

This is a regression in 3.4

Code

import metadataFullJson from "libphonenumber-js/metadata.full.json";

tsconfig:

    "composite": true,
    "module": "commonjs",
    "resolveJsonModule": true,

Expected behavior:

file compiles

Actual behavior:

error TS6307: File 'redacted/node_modules/libphonenumber-js/examples.mobile.json' is not in project file list. Projects must list all files or use an 'include' pattern.

Related Issues:

#25636

@RyanCavanaugh
Copy link
Member

@sheetalkamat what's the intended behavior here?

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Apr 17, 2019
@sheetalkamat
Copy link
Member

We do have explicit check for json file from project reference so those should work correctly.
@mikea Please provide repro steps to be able to investigate this further and determine if its a configuration error or something we need to fix in compiler

@sheetalkamat sheetalkamat added Needs More Info The issue still hasn't been fully clarified and removed Needs Investigation This issue needs a team member to investigate its status. labels Apr 18, 2019
@thovden
Copy link

thovden commented Apr 19, 2019

I'm also experiencing this problem - using a monorepo with npm link'ed packages. tsc -b from the top level causes this problem. Compiling the individual packages succeed without errors. Can be an error in my setup of the composite project of course.

@sheetalkamat
Copy link
Member

@thovden please share minimal repro steps so we can take further action thanks

@thovden
Copy link

thovden commented Apr 20, 2019

@sheetalkamat seems like I'm not able to reproduce using tsc only but it does occur when using ts-loader with webpack in a composite project. So this may be a ts-loader problem.

@thovden
Copy link

thovden commented Apr 22, 2019

TypeStrong/ts-loader#905 - so for now typescript is not the prime suspect from my side :)

@sheetalkamat
Copy link
Member

Closing this since its not an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

4 participants