reasonml-old / bs-node

Node bindings for BuckleScript
78 stars 17 forks source link

Node.Path.resolve breaks the build on latest bs-platform #7

Closed zploskey closed 6 years ago

zploskey commented 6 years ago

Calling Node.Path.resolve() breaks the build when using bs-platform 2.2.2.

  We've found a bug for you!
  /home/zach/src/bs-puppeteer/__tests__/puppeteer_test.re

  It's possible that your build is stale.
  Try to clean the artifacts and build again?

  Here's the original error message
  The files /home/zach/src/bs-puppeteer/node_modules/bs-node/lib/ocaml/node.cmi
  and src/Puppeteer-BsPuppeteer.cmi make inconsistent assumptions
  over interface Node

ninja: build stopped: subcommand failed.
>>>> Finish compiling(exit: 1)

I think this is because the type signatures differ between bucklescript's resolve and the one included here. BS has it as string -> string -> string, whereas the one here takes an array of strings using [@@bs.splice].

Not sure what the best way to deal with this is. We actually only really wanted to use the Buffer module.

zploskey commented 6 years ago

Adding "namespace": true, to bs-node's bsconfig.json seems to allow a peaceful coexistence. The library can then be used BsNode.Node.Buffer etc. Does this seem reasonable as at least part of the API is currently incompatible with bs-platform?

ncthbrt commented 6 years ago

That seems reasonable. Mind sending a PR this way?