Git Product home page Git Product logo

Comments (10)

guybedford avatar guybedford commented on May 21, 2024 1

(I also just checked bcrypt and can confirm that is working too)

from webpack-asset-relocator-loader.

guybedford avatar guybedford commented on May 21, 2024

I just tried this case out and it is working completely fine for me.

Are you running in Windows perhaps?

from webpack-asset-relocator-loader.

guybedford avatar guybedford commented on May 21, 2024

Ah I see you say macOS... would be odd if this was a Mac/Linux difference.

Perhaps try reinstalling to ensure the fsevents build is running? And the code definitely works without an ncc build?

from webpack-asset-relocator-loader.

timfish avatar timfish commented on May 21, 2024

chokidar bundles fine on Linux and Windows because fsevents is an optional dependency that installs on macOS only.

It's heavily relied on for macOS file watching.

I'll have another look at this today and see where the binary ends up.

from webpack-asset-relocator-loader.

timfish avatar timfish commented on May 21, 2024

I've found a cross-platform module that uses node-pre-gyp in a similar way and gives the same warnings, although it is outputting a working bundle:

package.json

{
  "name": "ncc-test",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "bcrypt": "^3.0.4",
  }
}

index.js

const bcrypt = require('bcrypt');

bcrypt.hash('s0/\/\P4$$w0rD', 10, function(err, hash) {
    console.log('Hash:', hash)
});

Build output

λ ncc build index.js
ncc: Module directory "C:\Users\tim\Documents\Repositories\ncc-test\node_modules\bcrypt\node_modules\node-pre-gyp\lib" attempted to require "aws-sdk" but could not be resolved, assuming external.
ncc: Module directory "C:\Users\tim\Documents\Repositories\ncc-test\node_modules\bcrypt\node_modules\node-pre-gyp\lib" attempted to require "aws-sdk" but could not be resolved, assuming external.
ncc: Module directory "C:\Users\tim\Documents\Repositories\ncc-test\node_modules\bcrypt\node_modules\node-pre-gyp\lib" attempted to require "aws-sdk" but could not be resolved, assuming external.
ncc: Module directory "C:\Users\tim\Documents\Repositories\ncc-test\node_modules\bcrypt\node_modules\node-pre-gyp\lib\util" attempted to require "node-gyp" but could not be resolved, assuming external.
ncc: Module directory "C:\Users\tim\Documents\Repositories\ncc-test\node_modules\bcrypt\node_modules\node-pre-gyp\lib\util" attempted to require "npm" but could not be resolved, assuming external.
ncc: Module directory "C:\Users\tim\Documents\Repositories\ncc-test\node_modules\bcrypt\node_modules\node-pre-gyp\lib" attempted to require "request" but could not be resolved, assuming external.
   0kB  dist\node-pre-gyp/contributing.md
   0kB  dist\node-pre-gyp/lib/util/nw-pre-gyp/package.json
   0kB  dist\nw-pre-gyp/package.json
   0kB  dist\node-pre-gyp/bin/node-pre-gyp.cmd
   1kB  dist\node-pre-gyp/lib/util/nw-pre-gyp/index.html
   1kB  dist\node-pre-gyp/LICENSE
   1kB  dist\node-pre-gyp/appveyor.yml
   1kB  dist\nw-pre-gyp/index.html
   2kB  dist\node-pre-gyp/package.json
   2kB  dist\package.json
   3kB  dist\node-pre-gyp/bin/node-pre-gyp
  13kB  dist\node-pre-gyp/CHANGELOG.md
  24kB  dist\node-pre-gyp/lib/util/abi_crosswalk.json
  32kB  dist\node-pre-gyp/README.md
 162kB  dist\lib/binding/bcrypt_lib.node
 996kB  dist\index.js
1238kB  [2104ms] - ncc 0.15.2

from webpack-asset-relocator-loader.

guybedford avatar guybedford commented on May 21, 2024

Yeah this sounds like a Mac-specific issue. Unfortunately I just got rid of my mac, so can't easily debug this now.

Can you share the exact runtime execution error that you get? The original posted in the issue is the build output not the execution output.

from webpack-asset-relocator-loader.

guybedford avatar guybedford commented on May 21, 2024

@timfish just to let you know the latest version of ncc and this loader have just been published with some fixes for MacOS, which may resolve some of the issues here.

from webpack-asset-relocator-loader.

styfle avatar styfle commented on May 21, 2024

@guybedford Regarding macOS, see #5

from webpack-asset-relocator-loader.

guybedford avatar guybedford commented on May 21, 2024

I just tested this exact replication case with the new ncc beta release and this is building fine for me, including emitting the fsevents.node file.

Closing as resolved, but please reopen if I'm missing anything.

I'll be PR'ing the integration test into ncc itself with the next batch of changes.

from webpack-asset-relocator-loader.

guybedford avatar guybedford commented on May 21, 2024

Although note that for support of require('asdf.node') files, this requires setting the asset relocation loader to run for these files. See the ncc configuration as an example here - https://github.com/zeit/ncc/blob/master/src/index.js#L146.

from webpack-asset-relocator-loader.

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.