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

resolveJsonModule not working #53

Closed
jpike88 opened this issue Jun 7, 2018 · 8 comments
Closed

resolveJsonModule not working #53

jpike88 opened this issue Jun 7, 2018 · 8 comments

Comments

@jpike88
Copy link
Contributor

jpike88 commented Jun 7, 2018

I get this error when turning on resolveJsonModule:

/Users/Me/Project/angularHelpers.ts (4,26) (Error:TS2307) Cannot find module './en-AU.json'

Can you confirm whether resolveJsonModule works for you at all?

Using TS 2.9.1, VSCode actually reports it as fine, and tsc has a weirder issue going on:

microsoft/TypeScript#24743

UPDATE: the weirder issue seems to be deliberate...

microsoft/TypeScript#24715

Thanks

@vegarringdal
Copy link
Member

vegarringdal commented Jun 7, 2018

Sample
https://github.com/vegarringdal/toDelete

error in studio, just to see that it works
image

Error typescript produces:
image

Option error goes away if I add the outDir

{
  "compilerOptions": {
    "module": "commonjs",
    "outDir": "",
    "resolveJsonModule": true,
    "esModuleInterop": true
  },
  "exclude": [
    "node_modules"
  ]
}

@vegarringdal
Copy link
Member

Update, tried to read more about this
It says here it will try and copy over the to files to output, so warning is kinda correct... maybe

image

@vegarringdal
Copy link
Member

@jpike88
How did this turn out ?

@jpike88
Copy link
Contributor Author

jpike88 commented Jun 12, 2018

I think you're right, I'm going to close this for now and avoid it as it's a bit of an edge case anyway.

This issue I'm following in TS, if that is implemented that would probably be what I'd use instead anyhow

microsoft/TypeScript#24744

@jpike88 jpike88 closed this as completed Jun 12, 2018
@jpike88 jpike88 reopened this Jun 19, 2018
@jpike88
Copy link
Contributor Author

jpike88 commented Jun 19, 2018

I think we should build in exemptions to omit this error. The problem is that outDir shouldn't need a value for this to do its job, which is just to check types. Files being written/not written shouldn't be a factor here.

@vegarringdal
Copy link
Member

yes, we could add a option to skip ts errors, as a option.

@vegarringdal
Copy link
Member

@jpike88
skipTsErrors?: number[];// skip ts errors to options

Can test it here:
fuse-box-typechecker@2.10.0-next.7

Tell me how it works out for you

@jpike88
Copy link
Contributor Author

jpike88 commented Jun 21, 2018

this solves the issue. eagerly awaiting release :D

@jpike88 jpike88 closed this as completed Jun 21, 2018
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

2 participants