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

Nativescript/shematics - does not work on device. #277

Open
javidsch opened this issue Jun 12, 2020 · 2 comments
Open

Nativescript/shematics - does not work on device. #277

javidsch opened this issue Jun 12, 2020 · 2 comments

Comments

@javidsch
Copy link

javidsch commented Jun 12, 2020

I've created app via this command. Generated template for Code sharing project.
ng new --collection=@nativescript/schematics sass-project --shared

Interesting:
There is not app-variables.scss file, among generated files.
https://docs.nativescript.org/angular/code-sharing/creating-a-new-project.html#sass

It works on web. (http://localhost:4200/)
ng serve

But it does not work on device (ios)
tns run ios --bundle

Error here:

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/javid/Documents/Angular/sass-project/node_modules/schema-utils/dist/validate.js:96:11)
    at new CopyPlugin (/Users/javid/Documents/Angular/sass-project/node_modules/copy-webpack-plugin/dist/index.js:24:30)
    at module.exports (/Users/javid/Documents/Angular/sass-project/webpack.config.js:302:13)
    at handleFunction (/Users/javid/Documents/Angular/sass-project/node_modules/webpack-cli/bin/prepareOptions.js:23:13)
    at prepareOptions (/Users/javid/Documents/Angular/sass-project/node_modules/webpack-cli/bin/prepareOptions.js:9:5)
    at requireConfig (/Users/javid/Documents/Angular/sass-project/node_modules/webpack-cli/bin/convert-argv.js:136:14)
    at /Users/javid/Documents/Angular/sass-project/node_modules/webpack-cli/bin/convert-argv.js:142:17
    at Array.forEach (<anonymous>)
    at module.exports (/Users/javid/Documents/Angular/sass-project/node_modules/webpack-cli/bin/convert-argv.js:140:15)
    at /Users/javid/Documents/Angular/sass-project/node_modules/webpack-cli/bin/cli.js:241:39
    at Object.parse (/Users/javid/Documents/Angular/sass-project/node_modules/webpack-cli/node_modules/yargs/yargs.js:567:18)
    at /Users/javid/Documents/Angular/sass-project/node_modules/webpack-cli/bin/cli.js:219:8
    at Object.<anonymous> (/Users/javid/Documents/Angular/sass-project/node_modules/webpack-cli/bin/cli.js:538:3)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/javid/Documents/Angular/sass-project/node_modules/webpack/bin/webpack.js:156:2)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879: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.
@javidsch javidsch changed the title Nativescript/shematics - did not work on device. Nativescript/shematics - does not work on device. Jun 12, 2020
@javidsch
Copy link
Author

Actually, this issue is related to version of "@angular-devkit/build-angular".

For me works!

After generating code sharing project:

  • Drop folders: 'hooks', 'node_modules', 'platforms'
  • Drop files: 'package-lock.json', 'webpack.config.js'
  • Change version of '@angular-devkit/build-angular' from current (~0.803.0) to ~0.7.0 ; Then run npm install
  • Then change '@angular-devkit/build-angular' version to current one (~0.803.0). Then run nmp install
  • Test: tns run ios --bundle

@acoppola
Copy link

Seems an issue with webpackcopyplugin, the latest 6.xx has a breaking changes while the webpack.config.js use the old sintax

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

No branches or pull requests

2 participants