I have a set of codes. (sorry cannot produce it since it is huge). But this acts properly locally. But when deployed on shiny server pro, it is not working.
I checked all libraries that are loaded are of same version.
One question, even if libraries are not loaded and there version are different between local and shiny server. Will this effect the application?
Yes, different versions of packages can behave differently.
For the local Shiny app, you might want to check if there are any objects being stored locally, not in Shiny. One easy way to check this is, if you run the app, do you see any objects in the (global) environment?
For package versions, you might be interested in renv or golem (note: not an expert on this)
Thanks. Just to double confirm. Even if libraries are not loaded in the application, they should be same?
FOr example
my app has
library(A) ##----- 3.6 version (both locally and shiny server)
library(B)##----- 3.5 version (both locally and shiny server)
library(C)##----- 3.8 version (both locally and shiny server)
Other libraries that are not loaded in my app
library(X) ##----- 2.6 version - locally and 2.5 version - shiny server
library(Y)##----- 1.6 version - locally and 1.5 version - shiny server
library(Z)##----- 7.6 version - locally and 7.5 version - shiny server
You mean even because of second scenario the apps can behave differently?
Apps can call other apps as dependencies so it is possible that A uses X under the hood.
Also, you are not specifying in which sense they behave differently, maybe your problem is not related to package version differences, is very har to give you any meaningful advice with so little and vague information, we are basically just guessing.
Also I observed one thing, Below is the image of my local R. I can see 20 packages. But on shiny server, i see only 6 packages. Is it because of this? But I Loaded all libraries, but not sure why it is showing only 6 packages. Can you please help?
I think I got the issue. The reason why it is working properly in locally is , when I run the app first app, the app does not work actually (my bad. I did not notice. But libraries are loaded). So when I open the app second time, it works well. So Can you help me here. How do i load the package globally ? Because in shiny server, even though I load the packages, it does not show under global environement
You don't want to load any objects in the global environment for Shiny; you actually want to empty it. I see in the image you uploaded that there are 5 objects, and four functions ('bo...', 'cr...', 'he...,' etc.). Make sure to run rm(list=ls()) before you run the Shiny app. If it doesn't work without rm(list=ls()), that means you had some scripts/code running before running the Shiny app that Shiny leveraged, which shouldn't be the case, because that code is (or should) not be included in the Shiny app unless you specifically included it in ui.R/server.R/app.R (even then, you should empty your environment).