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
Pr 5315 #5396
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Because the build file is user editable, it presents the possibility of a user introducing invalid javascript, which causes `require` to throw an error. I would like the error message to be more descriptive, but I couldn't get any more information from the exception require() threw. Also I was debating whether to use the full path, `buildFilePath`, or just the file name, `file`. I encountered this because I forgot a comma, and `ember s` returned this error: ``` Unexpected string SyntaxError: Unexpected string at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:374:25) at Object.Module._extensions..js (module.js:405:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at module.exports (/Users/michael/Sites/myemberapp/node_modules/ember-cli/lib/utilities/find-build-file.js:20:21) at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/michael/Sites/myemberapp/node_modules/ember-cli/lib/models/builder.js:49:21) at Class.module.exports.Task.extend.init (/Users/michael/Sites/myemberapp/node_modules/ember-cli/lib/models/builder.js:89:10) ``` Which this makes no sense. Now the error message will be: ``` Error: could not require "ember-cli-build.js": Unexpected string Error: Error: could not require "ember-cli-build.js": Unexpected string at module.exports (/Users/michael/Sites/myemberapp/node_modules/ember-cli/lib/utilities/find-build-file.js:24:8) at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/michael/Sites/myemberapp/node_modules/ember-cli/lib/models/builder.js:49:21) at Class.module.exports.Task.extend.init (/Users/michael/Sites/myemberapp/node_modules/ember-cli/lib/models/builder.js:89:10) at new Class (/Users/michael/Sites/myemberapp/node_modules/ember-cli/node_modules/core-object/core-object.js:18:12) at Class.module.exports.Task.extend.run (/Users/michael/Sites/myemberapp/node_modules/ember-cli/lib/tasks/serve.js:15:19) at /Users/michael/Sites/myemberapp/node_modules/ember-cli/lib/commands/serve.js:70:22 at lib$rsvp$$internal$$tryCatch (/Users/michael/Sites/myemberapp/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:493:16) at lib$rsvp$$internal$$invokeCallback (/Users/michael/Sites/myemberapp/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:505:17) at /Users/michael/Sites/myemberapp/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1001:13 at lib$rsvp$asap$$flush (/Users/michael/Sites/myemberapp/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1198:9) ``` While the stack trace doesn't help the user, at least I know the error is in `ember-cli-build.js`.
Using regex since Node versions output different error messages. Error thrown maintains error type, only modifies the message.
@homu r+ |
📌 Commit cc2bc3d has been approved by |
homu
added a commit
that referenced
this pull request
Jan 26, 2016
💔 Test failed - status |
@homu retry |
homu
added a commit
that referenced
this pull request
Jan 27, 2016
☀️ Test successful - status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.