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

Unable to use native module sharp with Electron 4.0.1 #16344

Closed
void-soul opened this issue Jan 10, 2019 · 2 comments
Closed

Unable to use native module sharp with Electron 4.0.1 #16344

void-soul opened this issue Jan 10, 2019 · 2 comments

Comments

@void-soul
Copy link

Output of node_modules/.bin/electron --version: 4.0.1
Operating System (Platform and Version): Windows 10
Output of node_modules/.bin/electron --version on last known working Electron version (if applicable): 3.0.7

Expected Behavior
A native module works when compiled against Electron.

Actual behavior
A native module sharp when required throws the following error:

Error: The specified module could not be found.
\\?\D:\pro\my\project\dmce-erp\client\node_modules\sharp\build\Release\sharp.node
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at bindings (D:\pro\my\project\dmce-erp\client\node_modules\bindings\bindings.js:84:48)
    at Object.<anonymous> (D:\pro\my\project\dmce-erp\client\node_modules\sharp\lib\constructor.js:10:34)

To Reproduce

setup a .yarnrc file with belows contents
disturl "https://atom.io/download/electron"
target "4.0.1"
runtime "electron"

add a dependency to package.json: "sharp": "^0.21.0"
run yarn
require sharp in the electron app
get the error

sharp's binding.gyp
win_delay_load_hook is not set to false, when I set win_delay_load_hook=true, still have this error

@welcome
Copy link

welcome bot commented Jan 10, 2019

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@MarshallOfSound
Copy link
Member

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

2 participants