Repository navigation
Closed
Description
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Max OS X, although I imagine that's not relevant. - Versions. Please run
ng --version. If there's nothing outputted, please run
in a Terminal:node --versionand paste the result here:
1.0.0-beta.11-webpack.8 - Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.
If you run ng build --help, you see as one option:
--environment (String) (Default: development)
aliases: -e <value>, -dev (--environment=development), -prod (--environment=production)
If you then run this
ng build --environment=production
you get "Path must be a string. Received undefined".
If you do ng build --environment=prod, it works. I'm assuming this is because there's an src/environments/environment.prod.ts file but not src/environments/environment.production.ts.
Seems like the help output should be corrected and you should get a friendlier error if you provide a bogus environment value.
- The log given by the failure. Normally this include a stack trace and some
more information.
Path must be a string. Received undefined
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.resolve (path.js:1148:7)
at Object.getWebpackCommonConfig (/Users/jasonswett/projects/scratch/foo/node_modules/angular-cli/addon/ng2/models/webpack-build-common.ts:128:80)
at new NgCliWebpackConfig (/Users/jasonswett/projects/scratch/foo/node_modules/angular-cli/addon/ng2/models/webpack-config.ts:13:30)
at Class.run (/Users/jasonswett/projects/scratch/foo/node_modules/angular-cli/addon/ng2/tasks/build-webpack.ts:16:22)
at Class.run (/Users/jasonswett/projects/scratch/foo/node_modules/angular-cli/addon/ng2/commands/build.ts:49:26)
at Class.<anonymous> (/Users/jasonswett/projects/scratch/foo/node_modules/angular-cli/lib/models/command.js:152:17)
at lib$rsvp$$internal$$tryCatch (/Users/jasonswett/projects/scratch/foo/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/Users/jasonswett/projects/scratch/foo/node_modules/rsvp/dist/rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (/Users/jasonswett/projects/scratch/foo/node_modules/rsvp/dist/rsvp.js:1019:11)
at lib$rsvp$asap$$flush (/Users/jasonswett/projects/scratch/foo/node_modules/rsvp/dist/rsvp.js:1198:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
- Mention any other details that might be useful.
Thanks! We'll be in touch soon.
Metadata
Metadata
Assignees
Labels
No labels
Activity
filipesilva commentedon Sep 21, 2016
Fixed by #2041 and latest (beta.15) release. Also see https://github.com/angular/angular-cli#webpack-update regarding changes in environments and upgrade path.
angular-automatic-lock-bot commentedon Sep 6, 2019
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.