electron-userland / electron-spellchecker

Implement spellchecking, correctly
MIT License
238 stars 83 forks source link

Module not found: Error: Can't resolve './build/Release/cld' #94

Open baversjo opened 7 years ago

baversjo commented 7 years ago

I added electron-spellchecker 1.1.2 to my package.json and the module compiled just fine. Other native modules work well. However I'm getting below error, on both osx and win 64 bit. I'm using electron-webpack. I added added import {SpellCheckHandler, ContextMenuListener, ContextMenuBuilder} from 'electron-spellchecker'; to my preload.js but get the following error when I launch electron-webpack dev:

ERROR in ./node_modules/@paulcbetts/cld/index.js
Module not found: Error: Can't resolve './build/Release/cld' in '/Users/johan/projects/smrt-system/electron/node_modules/@paulcbetts/cld'
 @ ./node_modules/@paulcbetts/cld/index.js 2:11-41
 @ ./node_modules/electron-spellchecker/lib/cld2.js
 @ ./node_modules/electron-spellchecker/lib/spell-check-handler.js
 @ ./node_modules/electron-spellchecker/lib/index.js
 @ ./src/renderer/preload.js

ERROR in ./node_modules/@paulcbetts/spellchecker/build/Release/spellchecker.node
Module parse failed: /Users/johan/projects/smrt-system/electron/node_modules/@paulcbetts/spellchecker/build/Release/spellchecker.node Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./node_modules/@paulcbetts/spellchecker/lib/spellchecker.js 3:15-60
 @ ./node_modules/electron-spellchecker/lib/node-spellchecker.js
 @ ./node_modules/electron-spellchecker/lib/index.js
 @ ./src/renderer/preload.js

ERROR in ./node_modules/keyboard-layout/build/Release/keyboard-layout-manager.node
Module parse failed: /Users/johan/projects/smrt-system/electron/node_modules/keyboard-layout/build/Release/keyboard-layout-manager.node Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./node_modules/keyboard-layout/lib/keyboard-layout.js 4:30-86
 @ ./node_modules/electron-spellchecker/lib/spell-check-handler.js
 @ ./node_modules/electron-spellchecker/lib/index.js
 @ ./src/renderer/preload.js

It's probably something stupid but thought I'd post here as I couldn't find anyone else with the same problem when searching historical issues.

claudio-incomedia commented 6 years ago

Same here. Have you found any solution? https://github.com/electron-userland/electron-spellchecker/pull/89 seems to have something related to this but applying the changes does not actually fix the issue.

claudio-incomedia commented 6 years ago

@baversjo which node version are you using? I suspect that this is not working with node 8 while it's ok with node 6.

baversjo commented 6 years ago

@claudio-incomedia Yes, I was using node 8. @paulcbetts Is this project compatible only with node 6/7? Electron has been on node v8.2.1 for a while.

0nn0 commented 6 years ago

Using node 7.9.0 and running into the issue as well unfortunately.

akinnee commented 6 years ago

Any update?

chrismohr commented 6 years ago

I ran into this yesterday, and got past it by adding node-loader to my webpack config.

module: {
  rules: [
    {
      test: /\.node$/,
      use: 'node-loader',
    },
  ],
},
iKBAHT commented 5 years ago

Got same error on following config:

"electron-spellchecker": "2.2.0",
"electron": "5.0.0",
nodejs: 12.6.0
WARNING in ./node_modules/@aabuhijleh/electron-remote/lib/renderer-require.js 26:19-46
Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/electron-spellchecker/src/promisify.js 4:16-26
Critical dependency: the request of a dependency is an expression

ERROR in ./node_modules/cld/index.js
Module not found: Error: Can't resolve './build/Release/cld' in '/Users/barebuh/Desktop/www/maat/node_modules/cld'
udittehri commented 3 years ago

Getting the same issue. Sick!