You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Developer workflow broken when linking plain JS app with NativeScript/tns-core-modules #7942
Describe the bug
I’m having problems trying to run the Hello World template app using the NativeScript source as described here
When trying to run the app I get the error attached in the screenshot at the end.
To Reproduce
clone the NativeScript project
tns create test-bkg-pos in the same folder where you cloned NativeScript
npm install --save ../NativeScript/tns-core-modules insede the project folder (i.e: test-bkg-pos)
tns run android
Expected behavior
The project should work using the source code for core modules.
Additional context
Not to flood this issue with a wall of text, I've attached the error as an image. If it turns out the problem is cause by something I did wrong, I'll replace it with the text for others that have the same issue to find this.
changed the title [-]Error when runing android app with NativeScritp source code[/-][+]Developer workflow broken when linking plain JS app with NativeScript/tns-core-modules[/+]on Oct 11, 2019
On Fri, Oct 11, 2019, 13:57 Nick Iliev ***@***.***> wrote:
@surdu <https://github.com/surdu> when executing tns create test-bkg-pos
are you creating a plain JavaScript project and if so can you please let me
know which template you are using?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7942?email_source=notifications&email_token=ACX4WG7WBVU4KGZ5TCAWDZ3QOBLZVA5CNFSM4I7P7H32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA7UK2Q#issuecomment-541017450>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACX4WG34K4UFUKRELPTDCUDQOBLZVANCNFSM4I7P7H3Q>
.
@surdu the thing is that the project you are using is plain JavaScript while the NativeScript/tns-core-modules (cloned from the repo) are written in TypeScript. So you need to transpile the tns-core-modules so that your plain JS project will have the transpiled JS files.
in NativeScript repository run
tsc
and then rebuild the test project you are good to go. The downside is that you will have to transpile the modules after each code change (in tns-core-modules). Or use tsc -w .
Another option is to grab the tsconfig.json from a TypeScript project and use it in your plain JS project. (but then you should NOT use tsc -w as it will conflict with the Webpack transpiling)
Activity
NickIliev commentedon Oct 11, 2019
Confirming the issue as reproducible when using plain JavaScript project.
Steps to reproduce: use the workflow described by @surdu above.
[-]Error when runing android app with NativeScritp source code[/-][+]Developer workflow broken when linking plain JS app with NativeScript/tns-core-modules[/+]surdu commentedon Oct 11, 2019
NickIliev commentedon Oct 11, 2019
@surdu the thing is that the project you are using is plain JavaScript while the NativeScript/tns-core-modules (cloned from the repo) are written in TypeScript. So you need to transpile the
tns-core-modulesso that your plain JS project will have the transpiled JS files.in NativeScript repository run
and then rebuild the test project you are good to go. The downside is that you will have to transpile the modules after each code change (in
tns-core-modules). Or usetsc -w.Another option is to grab the
tsconfig.jsonfrom a TypeScript project and use it in your plain JS project. (but then you should NOT usetsc -was it will conflict with the Webpack transpiling)surdu commentedon Oct 14, 2019
D'oh! Makes perfect sense! Thank you! I'll update the docs with this info.
vakrilov commentedon Oct 17, 2019
development-workflow.mdupdated in #7911