Git Product home page Git Product logo

Comments (8)

paulstraw avatar paulstraw commented on July 29, 2024

Can you send through the require statement you're using in your example/index.js?

from drift.

heloyo avatar heloyo commented on July 29, 2024

It is using a Deku component I am writing, but the component looks like:

import driftZoom from 'drift-zoom';

from drift.

paulstraw avatar paulstraw commented on July 29, 2024

Strange. Would it be possible for you to set up a reduced test case I can play with?

from drift.

heloyo avatar heloyo commented on July 29, 2024

Running npm run build with those files:

package.json:

{
  "scripts": {
    "build": "browserify --noparse=drift-zoom index.js -o test.js -dv"
  },
  "dependencies": {
    "drift-zoom": "^0.3.4"
  },
  "devDependencies": {
    "browserify": "^12.0.1"
  }
}

index.js:

var driftZoom = require('drift-zoom');

Results in this error:

Error: Cannot find module './util/throwIfMissing' from 'c:\x\y\drift-zoom-test\node_modules\drift-zoom\dist'
    at c:\x\y\drift-zoom-test\node_modules\resolve\lib\async.js:55:21
    at load (c:\x\y\drift-zoom-test\node_modules\resolve\lib\async.js:69:43)
    at onex (c:\x\y\drift-zoom-test\node_modules\resolve\lib\async.js:92:31)
    at c:\x\y\drift-zoom-test\node_modules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:82:15)

from drift.

paulstraw avatar paulstraw commented on July 29, 2024

Perfect, I'll take a look at this tomorrow. Thanks @heloyo!

from drift.

paulstraw avatar paulstraw commented on July 29, 2024

Hmmm. @heloyo, I spent a fair bit of time trying to figure out what's going on here. For some reason, Browserify seems to be ignoring(?) noParse. I'm unclear why this is happening. In the meantime, you can change your require to require('drift-zoom/dist/Drift.min.js') to work around this.

from drift.

jacobsvante avatar jacobsvante commented on July 29, 2024

Weird bug! Changing to require('drift-zoom/dist/Drift.min.js') worked, thanks @paulstraw.

from drift.

paulstraw avatar paulstraw commented on July 29, 2024

@jmagnusson, I think this was happening because noParse needs the full path. Can you try it with the value of require.resolve('drift-zoom')?

from drift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.