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

Cannot read property 'sourceDir' of undefined #619

Closed
ruwhan opened this issue May 4, 2016 · 7 comments · Fixed by #695
Closed

Cannot read property 'sourceDir' of undefined #619

ruwhan opened this issue May 4, 2016 · 7 comments · Fixed by #695

Comments

@ruwhan
Copy link

ruwhan commented May 4, 2016

I am filing a bug.

  1. OS. Mac OSX El Capitan.
  2. Versions:
angular-cli: 0.0.37
node: 5.1.0
os: darwin x64
  1. Repro steps:
    Just run ng serve
  2. Error logs:
 Cannot read property 'sourceDir' of undefined
TypeError: Cannot read property 'sourceDir' of undefined
    at new Angular2App (/Users/ruwhan/Projects/dfci/test-portal/node_modules/angular-cli/lib/broccoli/angular2-app.js:30:40)
    at module.exports (/Users/ruwhan/Projects/dfci/test-portal/angular-cli-build.js:6:10)
    at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/ruwhan/Projects/dfci/test-portal/node_modules/angular-cli/lib/models/builder.js:55:19)
    at Class.module.exports.Task.extend.init (/Users/ruwhan/Projects/dfci/test-portal/node_modules/angular-cli/lib/models/builder.js:89:10)
    at new Class (/Users/ruwhan/Projects/dfci/test-portal/node_modules/core-object/core-object.js:18:12)
    at Class.module.exports.Task.extend.run (/Users/ruwhan/Projects/dfci/test-portal/node_modules/angular-cli/lib/tasks/serve.js:15:19)
    at /Users/ruwhan/Projects/dfci/test-portal/node_modules/angular-cli/lib/commands/serve.js:64:24
    at lib$rsvp$$internal$$tryCatch (/Users/ruwhan/Projects/dfci/test-portal/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/ruwhan/Projects/dfci/test-portal/node_modules/rsvp/dist/rsvp.js:1048:17)
    at /Users/ruwhan/Projects/dfci/test-portal/node_modules/rsvp/dist/rsvp.js:331:11
    at lib$rsvp$asap$$flush (/Users/ruwhan/Projects/dfci/test-portal/node_modules/rsvp/dist/rsvp.js:1198:9)
    at doNTCallback0 (node.js:430:9)
    at process._tickCallback (node.js:359:13)
@metric152
Copy link

I ran into this earlier today
#616
Found the fixes for it.

@hansl
Copy link
Contributor

hansl commented May 4, 2016

Your angular-cli-build.js should pass an object as option to Angular2App. That object can be empty, but normally should include a vendorNpmFiles because we don't provide one for you anymore.

I'll leave this open as an issue that if no options object is passed in we should at least fail properly.

@AhmedAlgonsel
Copy link

I have the same issue also
I use win 10
64bit

@zeljko-bulatovic
Copy link

@AhmedAlgonsel change angular-cli.json to be like:
{
"routes": [],
"defaults": {
"sourceDir": "src/client"
}
}

Kind regards

hansl added a commit to hansl/angular-cli that referenced this issue May 9, 2016
hansl added a commit to hansl/angular-cli that referenced this issue May 9, 2016
hansl added a commit to hansl/angular-cli that referenced this issue May 9, 2016
hansl added a commit to hansl/angular-cli that referenced this issue May 9, 2016
@kamilshahzad
Copy link

i am facing same problem did all what is mentioned above but not resolved.

@damiendube
Copy link

I've create the file angular-cli.json to be like:
{
"routes": [],
"defaults": {
"sourceDir": "src"
}
}

And after that, I was able to run "ng serve", but this is not a fix. It is a workaround!
The issue is still present in angular-cli@1.0.0-beta.9, I suggest to re-open this issue until we fix the underling issue.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants