Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 10
Please run
ng --version
. If there's nothing outputted, please run in a Terminal:node --version
and paste the result here:
$ ng --version angular-cli: local (v1.0.0-beta.22-1, branch: master) node: 6.9.2 os: win32 x64
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
This app is working fine on 1.0.0-beta.21. On the latest master branch I get this error.
Normally this include a stack trace and some more information.
$ ng serve patterns.map is not a function TypeError: patterns.map is not a function at GlobCopyWebpackPlugin.apply (C:\projects\git\angular-cli\packages\angular-cli\plugins\glob-copy-webpack-plugin.ts:16:29) at Compiler.apply (C:\projects\git\angular-cli\node_modules\tapable\lib\Tapable.js:270:16) at WebpackOptionsApply.process (C:\projects\git\angular-cli\node_modules\webpack\lib\WebpackOptionsApply.js:59:18) at webpack (C:\projects\git\angular-cli\node_modules\webpack\lib\webpack.js:28:48) at Class.run (C:\projects\git\angular-cli\packages\angular-cli\tasks\serve-webpack.ts:38:27) at C:\projects\git\angular-cli\packages\angular-cli\commands\serve.ts:105:26 at process._tickCallback (internal/process/next_tick.js:103:7)
Tried on latest version, still an issue. Hope someone can shed a light on this! I really want to use the new i18n feature, our entire release depends on that feature... @hansl
I've done some research, in my case the patterns variable is a string, not an array...
I've "fixed" it by adding a check here:
if (patterns instanceof Array) {
patterns = patterns.map(pattern => fs.statSync(path.resolve(context, pattern)).isDirectory()
? pattern += '/**/*'
: pattern
);
}
However, I have no idea if this is intended behavior, and why this is now happening.
In my case, "patterns" equals "img".
Hope this helps.
I have same issue. Finally, It looks like caused by a scheme changing.
The item "assets" now is an array.
I set the value from "assets": "assets"
to "assets": ["assets"]
in angular-cli.json, and the error was gone.
The feature request: https://github.com/angular/angular-cli/issues/2405
This seems to be a problem with how we get defaults, which broke with #2405.
although issue has been closed... I had same exception when moving from beta.22-1 to beta.24; I changed "assets" parameter in angular-cli.json.
"assets: "assets"
"assets: [ "assets" ]
This parameter must be an array.
I have this problem as well, but on my platform, the angular-cli package.json
has more details in it, and changing to "assets": ["assets"]
causes an error.
Is there any more information I can provide or anything else I can do to support this?
Yup still have the same problem. I migrated from 1.0.0 beta 17 to 1.0.0 beta 30 and loicsalou solution worked for me.
"assets: [ "assets" ]
solves the problem.
still have same error on "angular-cli": "1.0.0-beta.28.3",
So it's not totally obvious from above, @glorment , but if you go into your
angular-cli.json
for your project, find the "apps"
section, change "assets": "assets"
, to "assets": ["assets"],
that fixed the problem for a bunch of folks!
So your *angular-cli.json
* will start something like:
{
"project": {
"version": "1.0.0-beta.32.3",
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": ["assets"],
This has been marked as a breaking change and is working as intended. People following updates of hte CLI shouldn't have any problems, and new projects are generated correctly.
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._
Most helpful comment
I have same issue. Finally, It looks like caused by a scheme changing.
The item "assets" now is an array.
I set the value from
"assets": "assets"
to"assets": ["assets"]
in angular-cli.json, and the error was gone.