Skip to content

bugfix: native module resolution is broken #3680

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Goli4thus
Copy link

Even though the official 'package.json' docs regarding "main" property make it seems like the recently introduced 'electronmon .' approach could work, it turns out that's not the case.

When going via 'main' property, regardless of the specified path, the actual "nodejs module resolution" will start at the '/node_modules/' level and then bubble upwards. As a result the symlinked folders '/src/node_modules' and '<repo/.erb/node_modules/' will not be considered, hence native module resolution breaks.

The solution is simply to specify the 'main.bundle.dev.js' file directly in regards to the 'electronmon' call.

Furthermore the 'main' property was removed altogether now, cause it seemingly serves no practical purpose in this template and at best is misleading if it were to stay around.

Even though the official 'package.json' docs regarding "main" property
make it seems like the recently introduced 'electronmon .' approach
could work, it turns out that's not the case.

When going via 'main' property, regardless of the specified path, the
actual "nodejs module resolution" will start at the
'<repo>/node_modules/' level and then bubble upwards.
As a result the symlinked folders '<repo>/src/node_modules' and
'<repo/.erb/node_modules/' will not be considered, hence native module
resolution breaks.

The solution is simply to specify the 'main.bundle.dev.js' file directly
in regards to the 'electronmon' call.

Furthermore the 'main' property was removed altogether now, cause it
seemingly serves no practical purpose in this template and at best is
misleading if it were to stay around.
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

Successfully merging this pull request may close these issues.

1 participant