R Code file is becoming 0 KB after saving

Hello Team,
It will be great if anyone can help
I've been using R for my data science course and usually, I've been using R for all course activities. Now I got a weird problem all R Code files after saving are becoming 0 KB whichever I saved from the past two days.
I tried uninstalling all my R and R Studio apps and reinstalling even then the problem did not get solved.

Thanks
-Prasoona

I have the same problem please help us

Hi, Try changing to R 4.1.3. That solved the problem for me. The files are not actually empty, but there is some bug with the RStudio editor. I had this error myself with R 4.2.0.

2022-06-01T12:07:47.153610Z [rsession-user_name] WARNING findProgramOnPath returns wrong result: C:\Users\user_name\AppData\Local\Programs\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe != C:/Users/user_name/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) C:\Users\jenkins\workspace\ide\open-source-pipeline\prairie-trillium\src\cpp\session\SessionModuleContext.cpp:1225
2022-06-01T12:07:47.153610Z [rsession-user_name] WARNING findProgramOnPath returns wrong result: C:\Users\user_name\AppData\Local\Programs\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe != C:/Users/user_name/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) C:\Users\jenkins\workspace\ide\open-source-pipeline\prairie-trillium\src\cpp\session\SessionModuleContext.cpp:1225
2022-06-01T12:07:47.166613Z [rsession-user_name] WARNING findProgramOnPath returns wrong result: C:\Users\user_name\AppData\Local\Programs\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe != C:/Users/user_name/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) C:\Users\jenkins\workspace\ide\open-source-pipeline\prairie-trillium\src\cpp\session\SessionModuleContext.cpp:1225
2022-06-01T12:07:47.166613Z [rsession-user_name] WARNING findProgramOnPath returns wrong result: C:\Users\user_name\AppData\Local\Programs\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe != C:/Users/user_name/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) C:\Users\jenkins\workspace\ide\open-source-pipeline\prairie-trillium\src\cpp\session\SessionModuleContext.cpp:1225
2022-06-01T12:07:51.186336Z [rsession-user_name] ERROR CLIENT EXCEPTION (rsession-user_name): (TypeError) : Cannot read property 'O' of null;|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditor.java#4516::setScrollSpeed|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditorMonitor.java#46::monitor|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditorMonitor.java#70::execute|||com/google/gwt/core/client/impl/SchedulerImpl.java#140::execute|||com/google/gwt/core/client/impl/Impl.java#306::apply|||com/google/gwt/core/client/impl/Impl.java#345::entry0|||rstudio-0.js#-1::eval|||com/google/gwt/cell/client/AbstractEditableCell.java#41::viewDataMap|||Client-ID: 33e600bb-c1b1-46bf-b562-ab5cba070b0e|||User-Agent: Mozilla/5.0 (Windows NT 10.0  Win64  x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36
2022-06-01T12:07:51.186336Z [rsession-user_name] ERROR CLIENT EXCEPTION (rsession-user_name): (TypeError) : Cannot read property 'O' of null;|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditor.java#4516::setScrollSpeed|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditorMonitor.java#46::monitor|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditorMonitor.java#70::execute|||com/google/gwt/core/client/impl/SchedulerImpl.java#140::execute|||com/google/gwt/core/client/impl/Impl.java#306::apply|||com/google/gwt/core/client/impl/Impl.java#345::entry0|||rstudio-0.js#-1::eval|||com/google/gwt/cell/client/AbstractEditableCell.java#41::viewDataMap|||Client-ID: 33e600bb-c1b1-46bf-b562-ab5cba070b0e|||User-Agent: Mozilla/5.0 (Windows NT 10.0  Win64  x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

Or at least this sounds like the same error. When I tried to open any file, the Rstudio editor showed it as empty. When opening the file with a different editor, it wasn't empty.

This is a known bug with RStudio and R 4.2. We have just released a new version of RStudio that doesn't have this problem, 2022.02.3. Get it here:

Apologize for the inconvenience!

Thanks @ freudianguy,
I tried opening in a different editor on a couple of files that had the code of lines and the rest are loaded as junk characters.
Hence I downgraded the version and worked on the projects.

-Prasoona

Thankyou Jonathan for addressing the query.
Sure will download the latest version

-Prasoona

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.