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

Cannot require('card') with browserify #190

Closed
kavun opened this issue Jul 21, 2015 · 6 comments
Closed

Cannot require('card') with browserify #190

kavun opened this issue Jul 21, 2015 · 6 comments

Comments

@kavun
Copy link

kavun commented Jul 21, 2015

Trying to use card with browserify. I'm getting an error

Error: Cannot find module './lib/extend' from 'C:\Projects\card-test\node_modules\card\lib\js'

My package.json

{
  "name": "card-test",
  "version": "1.0.0",
  "description": "card browserify test",
  "main": "index.js",
  "scripts": {
    "build": "browserify . > bundle.js"
  },
  "devDependencies": {
    "browserify": "^11.0.0"
  },
  "dependencies": {
    "card": "^1.1.0"
  }
}

My index.js

var card = require('card');

Running npm run build gives me the error above.

Any thoughts?

@chrisworrell
Copy link

I am running into the exact same error. Looks like the card.js is not referencing lib/extend properly since the extend.js resides in the node_modules and not where it is attempting to call it from in card.js unless of course I am missing some sort of setup step.

Really would love some help here as I really like the demo and would love to implement

@theopolisme
Copy link

This is indeed a drag, and hopefully can be fixed asap (this is a known problem with Browserify and attempting to require() browserified modules, see browserify/browserify#1151). One fix is indeed minifying the source files (see #191).

As a temporary fix I'm using card@1.0.0, which doesn't have this problem.

Thanks for the great library!

@duluca
Copy link

duluca commented Nov 5, 2015

Related to #197

@graup
Copy link

graup commented Jan 9, 2016

Can confirm card@1.0.0 works, will also use that version until this is fixed. Thanks all!

@jessepollak
Copy link
Owner

going to look into this — does anyone have a minimal repo that can show the error?

@jessepollak
Copy link
Owner

Nevermind, got it! Fix will go out in v1.2.2.

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

No branches or pull requests

6 participants