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

This code seems not to work with rescript 11.beta.2 and 3 #15

Closed
JasoonS opened this issue Jun 28, 2023 · 8 comments · Fixed by #16
Closed

This code seems not to work with rescript 11.beta.2 and 3 #15

JasoonS opened this issue Jun 28, 2023 · 8 comments · Fixed by #16

Comments

@JasoonS
Copy link
Contributor

JasoonS commented Jun 28, 2023

I get the following error after newly adding this package to a new project:

> envio-operator@0.1.0 build /home/jasoons/Documents/code/envio/envio-operator
> rescript build

Dependency on @ryyppy/rescript-promise
rescript: [5/5] src/Promise.cmj
rescript: [7/7] install.stamp
Dependency on rescript-nodejs
rescript: [58/118] src/Module-NodeJs.cmj
FAILED: src/Module-NodeJs.cmj

  We've found a bug for you!
  /home/jasoons/Documents/code/envio/envio-operator/node_modules/.pnpm/rescript-nodejs@14.4.0/node_modules/rescript-nodejs/src/Module.res:1:9-19

  1 │ include Node_module
  2 │ 

  The module or file Node_module can't be found.
  - If it's a third-party dependency:
    - Did you list it in bsconfig.json?
    - Did you run `rescript build` instead of `rescript build -with-deps`
      (latter builds third-parties)?
  - Did you include the file's directory in bsconfig.json?

rescript: [79/118] src/Buffer-NodeJs.cmj
FAILED: src/Buffer-NodeJs.cmj

  We've found a bug for you!
  /home/jasoons/Documents/code/envio/envio-operator/node_modules/.pnpm/rescript-nodejs@14.4.0/node_modules/rescript-nodejs/src/Buffer.res:1:10-20

  1 │ type t = Node.buffer
  2 │ open Js.TypedArray2
  3 │ 

  The module or file Node can't be found.
  - If it's a third-party dependency:
    - Did you list it in bsconfig.json?
    - Did you run `rescript build` instead of `rescript build -with-deps`
      (latter builds third-parties)?
  - Did you include the file's directory in bsconfig.json?

rescript: [97/118] src/Assert-NodeJs.cmj
FAILED: cannot make progress due to previous errors.
Failure: /home/jasoons/Documents/code/envio/envio-operator/node_modules/.pnpm/rescript@11.0.0-beta.3/node_modules/rescript/linux/ninja.exe 
Location: /home/jasoons/Documents/code/envio/envio-operator/node_modules/rescript-nodejs/lib/bs
 ELIFECYCLE  Command failed with exit code 1.

I'll clone locally and investigate a bit - seems strange - but I also don't know what Node_module is.

@JasoonS
Copy link
Contributor Author

JasoonS commented Jun 28, 2023

Yeah, this seems to be an issue with the core package.

Upgrading 'rescript' causes this issue:

diff --git a/package.json b/package.json
index fdfeb0b..7855cf1 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,7 @@
     "@dusty-phillips/rescript-zora": "^3.0.0",
     "onchange": "^7.1.0",
     "pta": "^1.0.0",
-    "rescript": "^10.0.1",
+    "rescript": "^11.0.0-beta.3",
     "zora": "^5.0.0"
   }
 }

I didn't see anything immediately obvious in release logs since v10.

@JasoonS
Copy link
Contributor Author

JasoonS commented Jun 28, 2023

That seems to be the problem node_modules/rescript/lib/ocaml/node_module.ml isn't there anymore.

@JasoonS
Copy link
Contributor Author

JasoonS commented Jun 28, 2023

Bingo... rescript-lang/rescript-compiler#6285

I'll try get the needed files added here :)

@TheSpyder
Copy link
Owner

TheSpyder commented Jun 29, 2023

Oh good find!

We could perhaps just add types to this project, but that would then make it incompatible with ReScript 10. I'll ask.

@JasoonS
Copy link
Contributor Author

JasoonS commented Jun 29, 2023

Yeah, maybe a major version bump, and it requires rescript 11 or higher?

@TheSpyder
Copy link
Owner

Bundling my own types is the recommended solution. And yes it will need a new major.

@DZakh
Copy link
Contributor

DZakh commented Jul 3, 2023

@JasoonS As a temp solution you can use the version from my PR:

    "rescript-nodejs": "github:DZakh/rescript-nodejs#3c29dcd",

@JasoonS
Copy link
Contributor Author

JasoonS commented Jul 3, 2023

Cool, thanks - beat me to it @DZakh 💪

@TheSpyder TheSpyder linked a pull request Jul 3, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants