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.

The automatically generated `tsconfig.json` file is missing `moduleResolution`

See original GitHub issue

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

$ next info

    Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64
    Binaries:
      Node: 16.15.0
      npm: 8.5.5
      Yarn: 1.22.17
      pnpm: 7.0.0
    Relevant packages:
      next: 12.1.7-canary.23
      react: 18.1.0
      react-dom: 18.1.0

What browser are you using? (if relevant)

N/A

How are you deploying your application? (if relevant)

N/A

Describe the Bug

Follow the instructions to install TypeScript, try starting the development server again.

View the generated tsconfig.json file:

Option ‘–resolveJsonModule’ cannot be specified without ‘node’ module resolution strategy.ts image

Expected Behavior

The generated tsconfig.json file should contain the moduleResolution key.

To Reproduce

# If you’re using npm
npm install --save-dev typescript @types/react @types/node

# If you’re using Yarn
yarn add --dev typescript @types/react @types/node

npm/yarn run dev

View the tsconfig.json file

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:20
  • Comments:6

github_iconTop GitHub Comments

9reactions
quaviouscommented, Aug 2, 2022

Adding "moduleResolution": "node" to tsconfig.json was worked.

1reaction
OksanaShtanheicommented, Aug 11, 2022

I added moduleResolution manually and it works

Read more comments on GitHub >

github_iconTop Results From Across the Web

Next.js TypeScript - The automatically generated tsconfig.json ...
The generated tsconfig.json gives an error like The automatically generated tsconfig.json file is missing moduleResolution.
Read more >
Documentation - Module Resolution - TypeScript
The TypeScript compiler supports the declaration of such mappings using paths property in tsconfig.json files. Here is an example for how to specify...
Read more >
Typescript does not resolve modules through tsconfig.json's ...
Please note that tsconfig.json file is stored not in the root of ... That is my config, 99% is auto-generated by Nativescript schematics....
Read more >
Understanding TypeScript's “Compilation Process” & the ...
The tsconfig.json file is a standard JSON file, however, ... These files are automatically generated by a build tool such as the TypeScript ......
Read more >
Using tsconfig.json - TypeScript
By invoking tsc with no input files and a --project (or just -p ) command line option that specifies the path of a...
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