rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Issue with genType Importing Modules in ReScript v11.1 with ReScript Core

Open PritishBudhiraja opened this issue 6 months ago • 6 comments

I'm using ReScript v11.1 and ReScript Core in my project, and I'm having trouble with genType. Specifically, I have a type that looks like this:

@genType
type hyperInstance = {
  ...,
  confirmOneClickPayment: (JSON.t, bool) => Promise.t<JSON.t>,
}

The compiler generates a file Types.gen.tsx for me, but I'm encountering the following issue:

import type {t as JSON_t} from './JSON.gen.tsx';

import type {t as Promise_t} from './Promise.gen.tsx';

I'm facing this issue in the rescript -

Cannot find module './JSON.gen.tsx' or its corresponding type declarations.ts(2307) Cannot find module './Promise.gen.tsx' or its corresponding type declarations.ts(2307)

I've followed the setup guide from the ReScript documentation here but can't seem to resolve this issue.

Steps I've Taken:

  • Ensured my gentypeconfig is correctly set up.
  • Checked paths and shim configurations.
  • Tried manual shimming but still facing issues.

My Environment:

  • ReScript v11.1
  • ReScript Core
  • TypeScript

Is there something I'm missing, or is this potentially a bug? Any help or guidance would be greatly appreciated.

  • [x] Is it a bug? Usage questions should often be asked in the forum instead.
  • [x] Concise, focused, friendly issue title & description.
  • [x] A minimal, reproducible example.
  • [x] OS and browser versions, if relevant.
  • [ ] Is it already fixed in master? Instructions

PritishBudhiraja avatar Aug 22 '24 09:08 PritishBudhiraja