microsoft / microsoft/TypeScript

error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'

Open
#30,978 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

TypeScript Version: 3.4.3

Search Terms: TS5071

Expected behavior:
Should compile for module: 'system'. I use a json-loader plugin within systemJS to load these json files. Earlier we used the .d.ts for json but with the latest upgrade it fails with the above error.

Related Issues:
https://github.com/Microsoft/TypeScript/issues/26224

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the TS5071 diagnostic with TypeScript 3.4.3 and module set to 'system', using the json-loader/SystemJS setup described in the issue. Read related issue 26224 for context; done should be defined as an agreed behavior for using resolveJsonModule with system module generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.