Forum Discussion
Script Runtime Error for R Script Visual
Hi there, I have an R Script Visual that works perfectly fine on Power BI Desktop, but after publishing it onto app.powerbi.com, I get the following error:
My script uses the dplyr, lubridate, ggplot2, and scales packages, which I believe are all supported. And the visual takes less than 2 seconds to load when coming from a different page on the desktop app. Any insight would be greatly appreciated!
Hi tyj,
Thanks for reaching out to the Microsoft fabric community forum.
After thoroughly reviewing the details you provided, that your R Script Visual runs fine in Power BI Desktop but encounters a Script Runtime Error when published to Power BI Service.Here are some possible reasons and troubleshooting steps to resolve the issue:
- Power BI Service only supports a specific set of R packages. While dplyr, lubridate, ggplot2, and scales are generally supported, some functions within these packages may not work in the service. Check the official list of supported R packages here: Supported R packages in Power BI
- Power BI Service uses a different R version than your desktop. compare versions and adjust accordingly.
- Scripts must complete within 5 minutes in the service. Try optimizing the script by reducing data size or processing complexity.
- A minimal script can help identify the issue. Publish a basic ggplot2 plot first, then add complexity gradually.
Personal Gateway is not required unless your script connects to on-premises data.
If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
5 Replies
- lbendlinSuper User
R and Python visuals mandate the use of a Personal Gateway if you want to consume them in the service.
- v-ssriganeshCommunity Support
Hi tyj,
Thanks for reaching out to the Microsoft fabric community forum.
After thoroughly reviewing the details you provided, that your R Script Visual runs fine in Power BI Desktop but encounters a Script Runtime Error when published to Power BI Service.Here are some possible reasons and troubleshooting steps to resolve the issue:
- Power BI Service only supports a specific set of R packages. While dplyr, lubridate, ggplot2, and scales are generally supported, some functions within these packages may not work in the service. Check the official list of supported R packages here: Supported R packages in Power BI
- Power BI Service uses a different R version than your desktop. compare versions and adjust accordingly.
- Scripts must complete within 5 minutes in the service. Try optimizing the script by reducing data size or processing complexity.
- A minimal script can help identify the issue. Publish a basic ggplot2 plot first, then add complexity gradually.
Personal Gateway is not required unless your script connects to on-premises data.
If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.- v-ssriganeshCommunity Support
Hi tyj,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.
Thank you.
- v-ssriganeshCommunity Support
Hi tyj,
May I ask if you have resolved this issue? If so, please mark it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
- v-ssriganeshCommunity Support
Hi tyj,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.