electron-userland / electron-json-storage

:package: Easily write and read user settings in Electron apps
1.43k stars 79 forks source link

Warning upon building with 4.1.6 (latest) #126

Closed james-criscuolo closed 4 years ago

james-criscuolo commented 5 years ago

I'm seeing a new warning when building with webpack, it's an angular AOT build:

WARNING in ./node_modules/electron-json-storage/node_modules/write-file-atomic/index.js
Module not found: Error: Can't resolve 'worker_threads' in '/{path_to_my_project}/node_modules/electron-json-storage/node_modules/write-file-atomic'
 @ ./node_modules/electron-json-storage/node_modules/write-file-atomic/index.js
 @ ./node_modules/electron-json-storage/lib/storage.js
 @ {where my import is}

This does not appear to break my build, so it does not look like I'll need to go to an earlier version. I import a non-standard way, but it appears the recommended way also causes it:

// import * as desktopStorage from "electron-json-storage";
const desktopStorage = require("electron-json-storage");

(both cause the issue) I can also confirm this does not occur with 4.1.5

jviotti commented 5 years ago

Hey @james-criscuolo ,

That looks like an issue on write-file-atomic, so I'd suggest re-opening this issue there. I believe it works fine in previous versions because this module started requiring write-file-atomic quite recently!

james-criscuolo commented 4 years ago

Closing this as Node 12 is now LTS, and it doesn't occur there.