-
Notifications
You must be signed in to change notification settings - Fork 463
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
[Blocking] Generated .bs.js code references a function that was not imported #6018
Comments
I created a new project using the ReScript template. I added a couple bindings for Firebase and the code doesn’t look like it will work. If you look at In FirebaseBindings.gen you’ll see a require... which I don’t understand since I configured it for es6. Why is there the require syntax? In |
Try For the @genType.import("foo/bar")
external aaa : string => string = "aaa"
@genType
let bbb = 10 But it does not happen here: @genType.import("foo/bar")
external aaa : string => string = "aaa" So you might want to re-arrange your files if that's a problem. |
OMG. I never would have figured this out and it was totally blocking me. I'm surprised there are no warnings or errors for annotations that aren't recognized. Thank you. |
All the annotations that are not recognised would need to give warnings. And different annotation processors recognise different annotations. So that would require some sort of global coordination. |
=== UPDATED ===
See this playground
I can't run my project because code I import into TypeScript doesn't work.
=== UPDATED ===
The generated code does not work; some kind of import problem, maybe related to
genType
. There is a much simpler repro scenario in https://github.com/jmagaram/rescript-issuesLook at
Firebase2Consumer.bs.js
- notice the call togetFirestore
, a function that is not imported.Look at
Firebase2.bs.js
- notice the call togetFirestore
, a function that should appear asFirebase2Gen.getFirestore
Adding a
.resi
file seems to fix it.=== ORIGINAL POST ===
I'm writing some bindings for Firebase. The generated code does not run because of problems with imports/exports.
rescript": "^10.1.2"
I created a vite Rescript app and added 2 files.https://github.com/jmagaram/rescript-issues
Look at the code generated in
UseFirebase.bs.js
. Notice thegetFirestore
function; it is not imported from anywhere. It should have been exported fromFirebase.bs.js
but is not. As I look closer atFirebase.bs.js
I see tons of problems. It references functions likeconnectFirestoreEmulator
but SHOULD referenceFirebaseGen.connectFirestoreEmulator
. Is this agenType
issue?The text was updated successfully, but these errors were encountered: