Skip to content

Sync fails if folder called tns_modules exists in app folder #2964

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

Closed
VladimirAmiorkov opened this issue Jul 10, 2017 · 3 comments
Closed

Sync fails if folder called tns_modules exists in app folder #2964

VladimirAmiorkov opened this issue Jul 10, 2017 · 3 comments

Comments

@VladimirAmiorkov
Copy link

Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?

Yes I have not found anything regarding such issue.

Tell us about the problem

The issue seams to be a strange one that for now I have managed to reproduce only on one machine. Basically after a second tns prepare ios some .js files from a plugins (node_modules of the project) are copied incorrectly to the platforms/ios/app name/app/tns_modules/plugin name

In my scenario when developing a plugin, if I change the source code of it in the node_modules and I run tns prepare ios that change I have made and saved is not sent to the prepared iOS app for any prepare after a clean prepare (rm -rf platform && tns prepare ios)

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.2.0-2017-07-07-9387 , I have tried with all official version back to 2.5.0
  • Cross-platform modules: 3.2.0-2017-7-7-2 , I have tried with official version also
  • Runtime(s): 3.2.0-2017-7-5-5, I have tried with official version also
  • npm: 3.10.10
  • node: v6.11.0

Please tell us how to recreate the issue in as much detail as possible.

Like I said for now this seam to be an issue that is local on my machine, but I have checked all npm settings, cleared cache, checked globally installed package and all looks ok.

  • Download this project
  • run tns prepare ios
  • open the .../sdk/node_modules/nativescript-telerik-ui-pro/listview/listview-common.js file and make a change (add a function, property or what ever)
  • make a small change to any of the app files so that the next prepare will be executed
  • run tns prepare ios
  • go to .../sdk/platforms/ios/sdk/app/tns_modules/nativescript-telerik-ui-pro/listview/listview-common.js and open it
  • search for your change from the previous step, it is not there. Seams that the entire .js files in the /sdk/platforms/ios/sdk/app/tns_modules/ folder has bee replaced with a different copy that the one that is in the projects node_modules

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

Not specifically, but while developing an plugin (meaning npm link for the source of it has been used) any changes to that plugins code is not synced correctly to the prepared iOS app after the first tns prepare ios

@VladimirAmiorkov VladimirAmiorkov changed the title 'tns prepare ios' sync wrong prlugin files to built platforms folder 'tns prepare ios' sync wrong plugin files to built platforms folder Jul 10, 2017
@VladimirAmiorkov VladimirAmiorkov changed the title 'tns prepare ios' sync wrong plugin files to built platforms folder 'tns prepare ios' sync wrong plugin files to the builded platforms folder Jul 10, 2017
@VladimirAmiorkov
Copy link
Author

VladimirAmiorkov commented Jul 10, 2017

My only workaround to this is to run rm -rf platforms/ && tns run ios because the first clean prepare/run is syncing the correct files always.

Btw live sync is also working.

@pkoleva pkoleva added the bug label Jul 11, 2017
@VladimirAmiorkov
Copy link
Author

VladimirAmiorkov commented Jul 11, 2017

Hi @pkoleva ,

I further investigated the issue and it was caused by an incorrect structure of the app fodler on my machine. What happened was that I had a folder named "tns_modules" inside my "app" folder, that folder was a copy of the prepared by CLI "tns_modules" located at /sdk/platforms/ios/sdk/app/ because of the copyAppSourceFiles function code here which was coping all of those files and placing them in the in the already prepared tns_modules folder replacing the newer versions of the plugin sources. I am not sure how the "tns_modules" folder was created in the projects "app" folder but I would blame it on the Mac OS Finder drag & drop :)

After removing that faulty ""tns_modules" folder the above issue was not longer present. We can close this issue.

On a side note, maybe we should consider some sort of check/warning if a folder named ""tns_modules" is present in the application source code ( "app" folder) because that modules folder is a important one that should not be be made "dirty" by app source code.

@VladimirAmiorkov VladimirAmiorkov changed the title 'tns prepare ios' sync wrong plugin files to the builded platforms folder 'tns prepare ios' sync wrong plugin files to the built platforms folder Jul 12, 2017
@dtopuzov dtopuzov changed the title 'tns prepare ios' sync wrong plugin files to the built platforms folder Sync fails if folder called tns_modules exists in app folder Jul 24, 2017
@dtopuzov
Copy link
Contributor

Closing if favor of #3016

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

No branches or pull requests

4 participants