chfi/purescript-genetics-browser

build error "not suitable as entry point"

kbroman opened this issue · 5 comments

I get an error when running npm run build-to pgs.js.

* Browserifying project in /home/kbroman/Code/purescript-genetics-browser
* Building project in /home/kbroman/Code/purescript-genetics-browser
* Build successful.
* Browserifying...
* Genetics.Browser.UI.Container.main is not suitable as an entry point because it:
*
*  - is not of type Control.Monad.Eff.Eff (is instead Prim.Function)
*
* If you need to create a JavaScript bundle without an entry point, use
* the --skip-entry-point flag.
*
* If you are certain that Genetics.Browser.UI.Container.main has the correct runtime
* representation, use the --check-main-type or --no-check-main flags
* to amend or skip this check.
*
* ERROR: Failed entry point check for module Genetics.Browser.UI.Container
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! purescript-genetics-browser@0.0.1 build-to: `pulp browserify --main Genetics.Browser.UI.Container --skip-entry-point --standalone PS --to "pgb.js"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the purescript-genetics-browser@0.0.1 build-to script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I don't quite understand it, because --skip-entry-point is being used.

If I modify package.json to include --check-main-type Prim.Function, it builds without errors, but if I insert the result into your genetics-browser-example, I get javascript errors (not shown).

Versions:

Pulp version 12.0.1
purs version 0.11.7 
npm version 5.7.1

I'm also confused about where to get the dalliance-all.js file, needed for example.html.

chfi commented

The readme is unfortunately out of date... I'll give it a refresh, thanks for the reminder!

chfi commented

Added a Makefile and updated the readme, should be easier to build now: https://github.com/chfi/purescript-genetics-browser#purescript-genome-browser

Cool, thanks. I'm now getting a different error with make test. But of course feel free to ignore this for now. And note that I edited the output a bit, since it was rather verbose.

Compiling Test.Coordinates
Error 1 of 3:
  in module Test.Coordinates
  at test/Coordinates.purs line 23, column 1 - line 23, column 48
    Unknown type Interval
Error 2 of 3:
  in module Test.Coordinates
  at test/Coordinates.purs line 56, column 12 - line 56, column 29
    Unknown value intervalToGlobal'
Error 3 of 3:
  in module Test.Coordinates
  at test/Coordinates.purs line 86, column 19 - line 86, column 35
    Unknown value intervalsOverlap
* ERROR: Subcommand terminated with exit code 1

Now that I think about it, this is a different error. Everything builds fine, it's just this one test error. So I'm going to close this issue and open a separate one.