You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an Electron project when using nodeLinker: pnp, you can't require external packages in main.js and Electron/Node will throw a "can't find module" error. This is irrelevant of the setting of enableGlobalCache. However it works for nodelinker: node-modules and nodelinker: pnpm.
This seems to be intended behavior on Electron's part, however since this isn't documented in the Troubleshooting section of the Migration docs (or anywhere else, and barely anywhere online period) it took me several days to realize this is what was going on. The docs should be updated (since the error is obtuse) and additionally it'd be nice to have some compatibility for nodelinker: pnp with enableGlobalCache: false at the very least, since those packages are still bundled with the app per-se.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In an Electron project when using
nodeLinker: pnp
, you can't require external packages inmain.js
and Electron/Node will throw a "can't find module" error. This is irrelevant of the setting ofenableGlobalCache
. However it works fornodelinker: node-modules
andnodelinker: pnpm
.This seems to be intended behavior on Electron's part, however since this isn't documented in the Troubleshooting section of the Migration docs (or anywhere else, and barely anywhere online period) it took me several days to realize this is what was going on. The docs should be updated (since the error is obtuse) and additionally it'd be nice to have some compatibility for
nodelinker: pnp
withenableGlobalCache: false
at the very least, since those packages are still bundled with the app per-se.Beta Was this translation helpful? Give feedback.
All reactions