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

steal.import() also loads "main" script #802

Closed
stucox opened this issue Jul 25, 2016 · 1 comment
Closed

steal.import() also loads "main" script #802

stucox opened this issue Jul 25, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@stucox
Copy link

stucox commented Jul 25, 2016

In a Node env, loading Steal & importing a script also imports the main script ("main" property in package.json if defined, otherwise attempts to load ./index.js)

// start.js
const steal = require('steal');
steal.import('src/app');
$ node start.js
Potentially unhandled rejection [4] Error: Error loading "index" at file:/Users/stuartcox/code/tmp/index.js
ENOENT: no such file or directory, open '<cwd>/index.js'
    at Error (native)

On #800 @matthewp said this should be considered a bug: presumably steal.import('src/app') should just load ./src/app.js (and its dependencies).

@matthewp matthewp added the bug label Jul 25, 2016
@matthewp matthewp self-assigned this Jul 25, 2016
@matthewp matthewp added this to the Bug fixes milestone Oct 6, 2016
@matthewp matthewp added the p2 label Oct 18, 2016
matthewp added a commit that referenced this issue Oct 24, 2016
This fixes it so that System.main isn't automatically loaded in Node. Instead System.main is only loaded if provided a main via configuration prior to the first steal.import() call. Closes #802
@matthewp
Copy link
Member

Closed by #885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants