ProgressNS / sidekick-feedback

This repository is for feedback regarding NativeScript Sidekick. Use the issues system here to submit feature requests or vote for existing ones.
45 stars 9 forks source link

Could not find module 'tns-core-modules/application' #393

Closed tsonevn closed 5 years ago

tsonevn commented 5 years ago

@alexisconsuegra commented on Sat Jun 29 2019

Environment

Describe the bug I started getting a runtime error Could not find module 'tns-core-modules/application' after a new build. It was working fine before the build.

tns_modules folder not livesynced. Using tns_modules from the already deployed bundle... Fatal JavaScript exception - application has been terminated. Native stack trace: 1 0x101ce3370 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState, JSC::Exception, bool) 2 0x101d1fc20 -[TNSRuntime executeModule:referredBy:] 3 0x100bd402c 4 0x1b97328e0 JavaScript stack trace: 1 require@file:///app/app.js:6:28 2 anonymous@file:///app/app.js:6:28 3 evaluate@[native code] 4 moduleEvaluation@[native code] 5 promiseReactionJob@[native code] JavaScript error: file:///app/app.js:6:28: JS ERROR Error: Could not find module 'tns-core-modules/application'. Computed path '/var/mobile/Containers/Data/Application/83A79C30-7F62-4499-A2B9-374478FEF58B/Library/Application Support/LiveSync/app/tns_modules/tns-core-modules/application'. JavaScript call stack: ( ) Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Error: Could not find module 'tns-core-modules/application'. Computed path '/var/mobile/Containers/Data/Application/83A79C30-7F62-4499-A2B9-374478FEF58B/Library/Application Support/LiveSync/app/tns_modules/tns-core-modules/application'. at 1 require@file:///app/app.js:6:28 2 anonymous@file:///app/app.js:6:28 3 evaluate@[native code] 4 moduleEvaluation@[native code] 5 promiseReactionJob@[native code] ', reason: '(null)' *** First throw call stack: (0x1b9ce127c 0x1b8ebb9f8 0x101ce37b4 0x101d1fc20 0x100bd402c 0x1b97328e0)

The app.js code

const application = require("tns-core-modules/application");
if (application.ios) {
    GMSServices.provideAPIKey("AIzaSyAaGj-OZ9mgCDUmOCuCfd7dctr22v2wugU");
}
application.run({ moduleName: "app-root" });

Expected behavior Application to start as before

tsonevn commented 5 years ago

Hi @alexisconsuegra, Try upgrading the project to the latest available version, while following the instruction here. Then clear up the workspace by selecting File->Clear Cloud Workspace in SideKick and try rebuilding the project, while using cloud builds.

alexisconsuegra commented 5 years ago

Thanks @tsonevn , I confirmed I have the latest CLI version (5.4.2) I tried then tns update and chose "Try Cloud Operation" and got the following message. In order to test your application use the $ tns login command to log in with your account and then $ tns cloud build command to build your app in the cloud. Does it mean it did not complete the update?

alexisconsuegra commented 5 years ago

It is working now. Thanks