Comments (10)
(I also just checked bcrypt
and can confirm that is working too)
from webpack-asset-relocator-loader.
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.
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.
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.
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.
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.
@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.
@guybedford Regarding macOS, see #5
from webpack-asset-relocator-loader.
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.
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)
- process.cwd() + package.json should be dynamic HOT 5
- Support for symlinks HOT 4
- Running in webpack watch mode doesn't work after a recompile. HOT 4
- Errors out when options isn't specified HOT 1
- With node-loader or awesome-node-loader
- Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths. HOT 1
- Inconsitant handling of path seperators resulting in generateWildcardRequire generating invalid conditions
- Does not work with Electron Forge and `serialport` v10 HOT 2
- [Windows] Path parts in strings replaced with undefined HOT 7
- Yarn berry pnp support HOT 2
- Module build Failed
- Output directory structure for native modules for Electron - any risks here?
- Nextjs native module different behavior in prod mode HOT 6
- Module not found: Error: Can't resolve '@vercel/webpack-asset-relocator-loader' HOT 2
- Better esm support HOT 2
- Binary relocation not working for bindings and node-pre-gyp
- Semver 7 dependency analysis fails HOT 1
- Dynamic require of .json where file extension is not provided
- How to make it work with babel? HOT 3
- Uncaught ReferenceError: __dirname is not defined HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webpack-asset-relocator-loader.