Closed NgxDev closed 3 years ago
@MrCroft If you can try your steps 1-3 with latest:
npx create-nx-workspace@latest nuvious
(and choose the "empty" preset)npm i --save-dev @nstudio/xplat
nx g app
(this needs the @nrwl/cli installed globally) and create a web angular app (I gave it the name 'tasks', same like in the Xplat course from NativeScripting). Also, I believe this step is optional. There is no problem with serving the web app, only with the nativescript app.nx g app
and create a nativescript angular app (also gave it the name 'tasks')Please note that after creating the {N} it provides the run commands to use; they will look something like this (using the name you provided, nativescript-{your-app-name} ):
nx run nativescript-mobile:ios
The core of the issue is just the npm scripts you're using - You don't need these npm scripts anymore (you can remove them) - they will cause issues with the webpack5 configuration: https://github.com/MrCroft/xplat-issue/blob/main/package.json#L30-L33
In the latest everything is standardized under hood to use the @nativescript/nx builder/executer which is why you can run everything with standard run commands, ie:
nx run nativescript-mobile:ios
nx run nativescript-mobile:android
// or if running a configuration
nx run nativescript-mobile:ios:prod
https://github.com/MrCroft/xplat-issue/blob/main/workspace.json#L413-L438
You can manage all the {N} cli options in the workspace.json for the app in that section ^ and can see here for what options are available to set: https://github.com/nativescript/nx#configuration-options
@NathanWalker I've just tried it out, and it's working perfectly now with the latest! So, I guess this issue can be closed. Sorry to have taken your time, thank you so much!
nativescript: 8.0.2 @nstudio/xplat: 12.7.0 @nrwl/cli: 12.7.1 @angular/core: 12.2.1
Can't start the nativescript app on a newly created workspace.
Repo (final result after running all the steps below): https://github.com/MrCroft/xplat-issue
Steps to reproduce (following the Xplat course from NativeScripting):
npx create-nx-workspace@latest nuvious
(and choose the "empty" preset)npm i --save-dev @nstudio/xplat
nx g app
(this needs the@nrwl/cli
installed globally) and create a web angular app (I gave it the name 'tasks', same like in the Xplat course from NativeScripting). Also, I believe this step is optional. There is no problem with serving the web app, only with the nativescript app.nx g app
and create a nativescript angular app (also gave it the name 'tasks')"start:ios": "cd apps/nativescript-tasks && ns run ios --no-hmr"
--force
works. But we want to run the migrations.cd apps/nativescript-tasks && ns migrate
. Which does the following:"@nativescript/webpack": "~5.0.0-beta.0"
toapps/nativescript-tasks/package.json
"compilerOptions"
toapps/nativescript-tasks/tsconfig.json
apps/nativescript-tasks/webpack.config.js
"clean:nativescript-tasks": "cd apps/nativescript-tasks && npx rimraf -- hooks node_modules platforms package-lock.json && npm i && npx rimraf -- package-lock.json"
A. First, there's the sass import errors. But that's a webpack thing (ns migrate didn't keep those aliases in the webpack.config.js). I could fix those easily by re-adding them to the webpack config myself. B. Then there are the errors I couldn't fix, regarding the
@tasks/xplat/...
imports. And VSCode also complains about those imports actually. I've even tried putting the paths from compilerOptions from tsconfig.base.ts in the tsconfig.app.ts in the nativescript app, then VSCode doesn't complain anymore, but I still get the same output/errors in the terminal.node: 14.7.2 npm: 6.14.13 nativescript: 8.0.2 @nstudio/xplat: 12.5.1 @nrwl/cli: 12.5.8 @angular/core: 12.1.2 (package.json lists 12.0.0, but looking in package-lock it's 12.1.2)