web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Custom Code (HTML & CS...
Power Pages
Suggested Answer

Custom Code (HTML & CSS) getting removed after some time interval.

(2) ShareShare
ReportReport
Posted on by 8
Whenever I write custom HTML and CSS to create a component on a page, the code gets removed from VS Code after a short period of time. I suspect this issue might be caused by synchronization, as I manually sync after every change, and multiple people are working on the same solution. What could be the reason for this problem?
Categories:
I have the same question (0)
  • Suggested answer
    Jon Unzueta Profile Picture
    1,827 Super User 2025 Season 2 on at
    @BM-07101856-0 maybe you can try this
     

    1. Use Source Control Branching

    • Create a feature branch for your changes.
    • Merge only after testing and review.
    • This avoids overwrites and makes it easier to track changes.

    2. Lock or Coordinate Web Resource Edits

    • Use a shared document or Teams channel to coordinate who is editing which component.
    • Avoid simultaneous edits to the same web resource.

    3. Use pac Commands Carefully

    When syncing:

    pac solution export --path ./output --name YourSolutionName --managed false

    Make sure you backup your local changes before running this, or use a diff tool to compare before overwriting.

    4. Track Web Resources in Git

    Ensure your .html, .css, and .js files are tracked in Git and committed regularly. Use .gitattributes to prevent auto-merging of binary or sensitive files.

    5. Use Comments or Markers

     
     
     
    This content may have been partially translated, structured, or generated with Copilot 🏷️ Tag me if you have any further questions or if the issue persists. ✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems. ❤️ Give it a Like if you found the approach useful in any way.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard