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

Sylvester cannot be used with browserify #4

Open
DavidBruant opened this issue Aug 14, 2015 · 3 comments
Open

Sylvester cannot be used with browserify #4

DavidBruant opened this issue Aug 14, 2015 · 3 comments
Milestone

Comments

@DavidBruant
Copy link

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.

@rreusser
Copy link

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')?

@rreusser
Copy link

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

@DavidBruant
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants