Native module "fswin" not working on Windows (typescript boilerplate)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- electron, node.js, typescript
- Domain
- build-system, desktop
Research direction
Start in examples/examples/typescript, especially index.tsx, and reproduce the failure with yarn dev after adding fswin. Compare the TypeScript example with the normal JavaScript ERB version and inspect the packaging or bundling path implicated by the ELECTRON_ASAR.js error. Done means fswin loads successfully in development and in the packaged app on Windows.
Written by the indexing model from the issue text.
Description
Prerequisites
- Using yarn
- Using node 10.x
- Using an up-to-date
masterbranch - Using latest version of devtools. See wiki for howto update
- Link to stacktrace in a Gist (for bugs)
- For issue in production release, devtools output of
DEBUG_PROD=true yarn build && yarn start - Tried solutions mentioned in #400
Expected Behavior
I can add and use the native module fswin when using the typescript boilerplate.
Current Behavior
I just don't get the module fswin to work with the typescript example of ERB; the app does not load and the following error in ELECTRON_ASAR.js:160 is written into the DevTools console:
Uncaught Error: The specified module could not be found.
\\?\D:\development\workspace\test-ts-fswin-error\node_modules\fswin\electron\x64\fswin.node
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:722)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
at Module.load (internal/modules/cjs/loader.js:602)
at tryModuleLoad (internal/modules/cjs/loader.js:541)
at Function.Module._load (internal/modules/cjs/loader.js:533)
at Module.require (internal/modules/cjs/loader.js:640)
at require (internal/modules/cjs/helpers.js:20)
at Object.<anonymous> (D:\development\workspace\test-ts-fswin-error\node_modules\fswin\index.js:3)
at Object.<anonymous> (D:\development\workspace\test-ts-fswin-error\node_modules\fswin\index.js:7)
The fswin.node file exist in the folder reported by the error. As I read in various github issues, such an error can occur even if the .node file exists if the native module did not get compiled correctly, due to DLLs not present on the working machine.
But since I can use the module with pure NodeJS, and also with the normal JS version of ERB (tested with ae89980), I am sure that the module got compiled correctly.
It seems to me like the module not getting bundled correctly when using your typescript boilerplate example.
Since I could not figure out the problem, I would be glad if you could help me!
Further notes:
- I tried both the traditional
requireand also the ES6importsyntax, without success. - The error also occurs when using
UPGRADE_EXTENSIONS=1 yarn dev, oryarn packageand starting the packaged app.
Steps to Reproduce (for bugs)
-
git clone https://github.com/electron-react-boilerplate/examples -
cd examples/examples/typescript -
yarn -
yarn add fswin -
for testing purposes, add the following lines to index.tsx:
...
import { configureStore, history } from './store/configureStore';
import './app.global.css';
const fswin = require('fswin'); // ADDED
console.log(fswin); // ADDED
const store = configureStore();
...
yarn dev--> Error is shown in the DevTools console, counter app is not loaded

Context
I am working with the file system on windows and want to know if files are hidden or system-files. Since both node and electron don't expose APIs for that, I have to use a native module, and fswin seems to be a good choice for that.
As you can see with the steps to reproduce, no changes in the boilerplate were made.
Your Environment
- Node version :
10.15.1 - Yarn version :
1.13.0 - Version or Branch used : 90294db
- Operating System and version : Windows 10 64-bit
- Dominant language
- No language data
- Stars
- 200
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from electron-react-boilerplate/examples
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Dependency DashboardOpen
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
electron-react-boilerplate/examples#45 · 1 comment · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in electron-react-boilerplate/examples
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
agent:blocked agent:ready
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
turbot/guardrails-fn#46 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudnative-pg/charts#1057 ·
Maintainers usually reply within 1 day
-
[Bazel CI] ERROR: Bazel Examples (Android Firebase Cloud Messaging) fails on macOS: no such target '@@androidsdk//:aapt2_binary'Possibly taken @deepalak56 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bazelbuild/examples#715 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100