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

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

Open
4 of 5 tasks
PritishBudhiraja opened this issue Aug 22, 2024 · 5 comments
Open
4 of 5 tasks
Assignees

Comments

@PritishBudhiraja
Copy link

PritishBudhiraja commented Aug 22, 2024

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.

  • Is it a bug? Usage questions should often be asked in the forum instead.
  • Concise, focused, friendly issue title & description.
  • A minimal, reproducible example.
  • OS and browser versions, if relevant.
  • Is it already fixed in master? Instructions
@cometkim cometkim self-assigned this Aug 27, 2024
@cometkim
Copy link
Member

@cknitt @fhammerschmidt We need to restore the genType shims documentation for v11 users.

@fhammerschmidt
Copy link
Contributor

@cometkim Here you go: rescript-association/rescript-lang.org#906
(Can't add you as a reviewer over there unfortunately)

@fhammerschmidt
Copy link
Contributor

@PritishBudhiraja
Copy link
Author

Hey @fhammerschmidt @cometkim ,

So we tried using shims. It worked for Js library and made it compiled too.

Screenshot 2024-09-03 at 3 38 34 PM

But still I have few issues.

We have updated our repo to v11 and using rescript-core everywhere. So we tried to make this work in the same way but it didn't. Can you please guide us where it's going wrong? or shim folder structure for the same. It's getting a bit confusing.

Screenshot 2024-09-03 at 3 34 18 PM
Screenshot 2024-09-03 at 3 34 36 PM

The versions are mentioned in the above description.

Thanks!

@PritishBudhiraja
Copy link
Author

Hey @cometkim @fhammerschmidt any update on the above issue. Like how can we resolve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants