Skip to content

Sylvester cannot be used with browserify #4

Open

Description

@DavidBruant

Browserify emits en error message:
Error: Cannot find module 'lapack' from '<path>/node_modules/sylvester/lib/node-sylvester'

One way to fix the issue would be to add lapack as dependency of sylvester. In the meantime, I use browserify's --ignore lapack option.

Activity

  1. rreusser commented on Aug 14, 2015

    @rreusser

    Looks like the suspect portion might be getLapack:

    function getLapack() {
        try {
            return require('lapack');
        } catch(e) {}
    }
    

    Browserify finds and acts on these requires regardless of surrounding logic, right? (In other words, no conditional requires)

    Perhaps this needs to be removed and replaced with dependency injection? I.e.:

    require('sylvester')( require('lapack') )
    or
    require('sylvester')()
    

    That's kind of a major breaking change though. Disclaimer: just a guess on my part. I haven't tried any of this. Is there an alternate approach to dependency injection that wouldn't break plain require('sylvester')?

  2. rreusser commented on Aug 14, 2015

    @rreusser

    Possible workaround: substack states that a solution to the halting problem would enable conditional requires. Looks like there's a node module for that 😉

  3. DavidBruant commented on Aug 14, 2015

    @DavidBruant
    Author

    Blarf! I'll stick to --ignore as a workaround for now :-p

  4. added this to the 1.0.0 milestone on Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions