NativeScript / nx

NativeScript for Nx.
Other
64 stars 17 forks source link

impossible to run on device and emulator #2

Closed Sergiy32 closed 3 years ago

Sergiy32 commented 3 years ago

Hello, I've tried a few times to make a simple project using Nx Workspace, but all the time the issue is the same.

Everything was successfully installed, I called the app "mobileapp", but when I tried to tun this command

npx nx run nativescript-mobileapp:ios

I got an error:

ERROR in ./main.ts Module build failed (from ../node_modules/@ngtools/webpack/src/index.js): Error: /workspace-path/apps/nativescript-mobileapp/src/main.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. at NativeScriptAngularCompilerPlugin.getCompiledFile (/workspace-path/apps/nativescript-mobileapp/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:951:23) at NativeScriptAngularCompilerPlugin.getCompiledFile (/workspace-path/apps/nativescript-mobileapp/node_modules/@nativescript/webpack/plugins/NativeScriptAngularCompilerPlugin.js:29:26) at /workspace-path/apps/nativescript-mobileapp/node_modules/@ngtools/webpack/src/loader.js:43:31 at processTicksAndRejections (internal/process/task_queues.js:93:5)

but the main.ts file exists! here is the path

/workspace-path/apps/nativescript-mobileapp/src/main.ts

Also the file main.ts included in tsconfig.app.json

/workspace-path/apps/nativescript-mobileapp/tsconfig.app.json

{ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../dist/out-tsc", "types": [] }, "files": ["./references.d.ts", "./src/main.ts"] }

maxfriedmann commented 3 years ago

I get the same error, I can even click on the missing file in the console and it opens :)

In addition, additional dependencies are getting installed in apps/nativescript-mobileapp/node_modules, this is different to what (all) other workspace plugins do which I know.

I am using nx v11.0.15 and angular v11.0.9 on windows.

Crikey-Mikey commented 3 years ago

I get same error OSX 11.1. Anyone had success?

Crikey-Mikey commented 3 years ago

looks like workspace.json needs to point to correct tsconfig file:

"options": {
    "tsConfig": "apps/nativescript-app/tsconfig.app.json",
}
NathanWalker commented 3 years ago

We hope to finalize things here over the next 2-3 weeks - in particular the next thing to be added is a custom builder which should make the interaction and config between nativescript apps and the workspace a bit more concise.

NathanWalker commented 3 years ago

This is fixed in the official 1.0.0 version.