Skip to content
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

Fix atom --dev with JSON config files #19270

merged 1 commit into from May 6, 2019


None yet
1 participant
Copy link

commented May 6, 2019

When running atom --dev using a local resource path e.g atom --dev --resource-path /foo and having a config.json file instead of the default config.cson, an error used to appear in the command line, preventing Atom from launching:

Error: Cannot find module '../initialize-application-window'
    at Module._resolveFilename (module.js:543:15)
    at Function.Module._resolveFilename (/Users/rafeca/github/atom/atom/out/Atom
    at Function.resolve (internal/module.js:18:19)
    at AtomApplication.openPaths (/Users/rafeca/github/atom/atom/src/main-process/atom-application.js:1106:46)
    at <anonymous>

This seems to be caused by the require system not handling coffee file extensions.

This works when using a cson config file because in order to parse that format, the coffeescript compiler needs to be initialized, which probably hooks on the require system to add the coffee extension. This PR changes the require.resolve to make it non-dependant on the fact that the coffeescript compiler has been loaded.

@rafeca rafeca merged commit ad3a7e8 into master May 6, 2019

2 checks passed

Atom Pull Requests #20190506.2 succeeded
continuous-integration/appveyor/pr AppVeyor build succeeded

@rafeca rafeca deleted the fix-json-config branch May 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.