Skip to content

Angular10 support #281

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

Closed
d-koppenhagen opened this issue Jun 18, 2020 · 4 comments
Closed

Angular10 support #281

d-koppenhagen opened this issue Jun 18, 2020 · 4 comments
Assignees

Comments

@d-koppenhagen
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Describe the solution you'd like
In the future the schematics should work with Angular 10.
Therefore the peer dependency of typescript should be bumped up from ~3.8.3 to ~3.9.5 as it's the new used version of Angular CLI

Describe alternatives you've considered

Additional context

@d-koppenhagen
Copy link
Contributor Author

d-koppenhagen commented Jun 25, 2020

Angular 10 is out now.
Running ng update @angular/cli on an existing Angular + {N} shared projects causes the following error message:

$ ng update @angular/cli        
Your global Angular CLI version (10.0.0) is greater than your local
version (9.1.2). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 40 dependencies.
Fetching dependency metadata from registry...
                  Package "@nativescript/angular" has an incompatible peer dependency to "typescript" (requires "~3.8.3", would install "3.9.5").
✖ Migration failed: Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.
  See "/private/var/folders/7n/fqslh59s19v764fsyc2k8r1c0000gn/T/ng-t27NRC/angular-errors.log" for further details.

This can be solved for now by adding the --force flag and is the minor problem:

ng update @angular/cli --force

But when running e.g. npm run ios, it leads to the following error message on console

$ npm run ios
> tns run ios --env.aot

Searching for devices...
Preparing project...
Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
 - options[0] misses the property 'patterns'. Should be:
   [non-empty string | object { from, to?, context?, globOptions?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
 - options[1] misses the property 'patterns'. Should be:
   [non-empty string | object { from, to?, context?, globOptions?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
 - options[2] misses the property 'patterns'. Should be:
   [non-empty string | object { from, to?, context?, globOptions?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
ValidationError: Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
    at validate (/Users/someUser/someNProjectPath/node_modules/schema-utils/dist/validate.js:96:11)
    at new CopyPlugin (/Users/someUser/someNProjectPath/node_modules/copy-webpack-plugin/dist/index.js:24:30)
    at module.exports (/Users/someUser/someNProjectPath/webpack.config.js:304:13)
    at handleFunction (/Users/someUser/someNProjectPath/node_modules/webpack-cli/bin/prepareOptions.js:23:13)
    at prepareOptions (/Users/someUser/someNProjectPath/node_modules/webpack-cli/bin/prepareOptions.js:9:5)
    at requireConfig (/Users/someUser/someNProjectPath/node_modules/webpack-cli/bin/convert-argv.js:136:14)
    at /Users/someUser/someNProjectPath/node_modules/webpack-cli/bin/convert-argv.js:142:17
    at Array.forEach (<anonymous>)
    at module.exports (/Users/someUser/someNProjectPath/node_modules/webpack-cli/bin/convert-argv.js:140:15)
    at /Users/someUser/someNProjectPath/node_modules/webpack-cli/bin/cli.js:241:39
    at Object.parse (/Users/someUser/someNProjectPath/node_modules/yargs/yargs.js:567:18)
    at /Users/someUser/someNProjectPath/node_modules/webpack-cli/bin/cli.js:219:8
    at Object.<anonymous> (/Users/someUser/someNProjectPath/node_modules/webpack-cli/bin/cli.js:538:3)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/someUser/someNProjectPath/node_modules/webpack/bin/webpack.js:156:2)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
Executing webpack failed with exit code 1.

This seems to be related to #277 as the error looks like the same.

Removing the platform target for iOS and adding it again, does also not help (tns platform remove ios && tns platform add ios)

@d-koppenhagen
Copy link
Contributor Author

The Bug seems to came from The Webpack Plugin "CopyWebpack". There were some Breaking Changes introduced lately: https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md#600-2020-05-15

@NathanWalker
Copy link
Contributor

NathanWalker commented Jul 2, 2020

Working Angular 10 support here: NativeScript/nativescript-angular#2189
Once that's published by early next week these schematics will be updated with the proper changes 👍

@ElecTreeFrying
Copy link

do we have any documentation on how to create NS project with Angular 10?

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

No branches or pull requests

3 participants