<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Utkarsh Tiwari</title>
    <description>The latest articles on DEV Community by Utkarsh Tiwari (@utk09).</description>
    <link>https://dev.to/utk09</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F781962%2F48199747-1a45-496e-b603-aa4ce761eb6b.jpeg</url>
      <title>DEV Community: Utkarsh Tiwari</title>
      <link>https://dev.to/utk09</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/utk09"/>
    <language>en</language>
    <item>
      <title>Solved: Tailwind properties missing in production</title>
      <dc:creator>Utkarsh Tiwari</dc:creator>
      <pubDate>Sun, 03 Mar 2024 03:18:27 +0000</pubDate>
      <link>https://dev.to/utk09/solved-tailwind-properties-missing-in-production-1ghc</link>
      <guid>https://dev.to/utk09/solved-tailwind-properties-missing-in-production-1ghc</guid>
      <description>&lt;p&gt;So, one fine (Monday) morning, I was fully committed to optimise my portfolio website - &lt;a href="https://utkarsh-tiwari-portfolio-react.netlify.app/" rel="noopener noreferrer"&gt;https://utkarsh-tiwari-portfolio-react.netlify.app/&lt;/a&gt;. Built using React and Tailwind CSS, everything was coming out great.&lt;/p&gt;

&lt;p&gt;When I deployed it on &lt;strong&gt;gh-pages&lt;/strong&gt;, something broke! The background colour behind the images in the &lt;strong&gt;skills section&lt;/strong&gt; was just &lt;em&gt;transparent&lt;/em&gt;!&lt;br&gt;
But I had properly given different colours like &lt;em&gt;bg-teal-100&lt;/em&gt;, &lt;em&gt;bg-amber-300&lt;/em&gt;, &lt;em&gt;bg-green-100&lt;/em&gt;, &lt;em&gt;bg-emerald-800&lt;/em&gt;, &lt;em&gt;bg-yellow-800&lt;/em&gt;, etc.&lt;/p&gt;

&lt;p&gt;I checked the localhost 10 times, it worked on my machine!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkityrgimwzisaplspadz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkityrgimwzisaplspadz.png" alt="It works on my machine meme - https://i.pinimg.com/736x/71/ff/d4/71ffd47d032be54a1fad877bded70868.jpg" width="630" height="630"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The problem exactly -
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Localhost&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtheshml8kuhmw11wiwn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtheshml8kuhmw11wiwn.png" alt="Localhost - bg colours injected properly" width="800" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The not-so Localhost a.k.a gh-pages&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foe33yhfynrncdqycv3vi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foe33yhfynrncdqycv3vi.png" alt="Production - bg colours are transparent" width="800" height="205"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The culprit =
&lt;/h2&gt;

&lt;p&gt;Turns out that while I was trying to be too smart for my own good and over-optimising the code, I dynamically injected the bg-colors from the skills.js file.&lt;/p&gt;

&lt;p&gt;Snapshot of &lt;em&gt;skillsData.js&lt;/em&gt; file -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;skillsData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;img&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/images/html-css-logo.png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;html-css-logo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;HTML &amp;amp; CSS&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;level&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Proficient&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;bgColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;teal-800&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Snapshot of &lt;em&gt;skills.jsx&lt;/em&gt; file -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;col-span-1 flex shadow-sm rounded-md&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;skill&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`bg-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;skill&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bgColor&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; text-sm font-medium justify-center w-16`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do you see the &lt;strong&gt;bgColor&lt;/strong&gt; property? That's being dynamically inserted!&lt;/p&gt;

&lt;p&gt;And when we build for production, Tailwind purges all the unused css to reduce the overhead and only adds the classes which are actually being used. &lt;/p&gt;

&lt;p&gt;So, the dynamic values (which are basically completing the property names) are not exactly "in-use" when purge css runs. Hence they are removed.&lt;/p&gt;

&lt;p&gt;(If you did not understand what I meant - &lt;em&gt;"The exact property name is &lt;strong&gt;bg-teal-500&lt;/strong&gt;, but since the code is split into two parts, it looks like the value is just &lt;strong&gt;bg-&lt;/strong&gt;"&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro&lt;/strong&gt; - File size is reduced and overall it will be faster.&lt;br&gt;
&lt;strong&gt;Con&lt;/strong&gt; - Dynamically injected values are not compiled and hence are lost in production.&lt;br&gt;
&lt;strong&gt;Result&lt;/strong&gt; - Transparent background 🥲&lt;/p&gt;

&lt;p&gt;PS: I've a new site on &lt;a href="https://utk09.com" rel="noopener noreferrer"&gt;utk09.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tailwindcss</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>react</category>
    </item>
    <item>
      <title>How to resolve vulnerabilities in Front-End Applications</title>
      <dc:creator>Utkarsh Tiwari</dc:creator>
      <pubDate>Sun, 03 Mar 2024 02:31:16 +0000</pubDate>
      <link>https://dev.to/utk09/how-to-resolve-vulnerabilities-in-front-end-applications-508n</link>
      <guid>https://dev.to/utk09/how-to-resolve-vulnerabilities-in-front-end-applications-508n</guid>
      <description>&lt;p&gt;If you're working with front-end frameworks like React.js, Angular, or Vue.js, or if your project relies on a &lt;code&gt;package.json&lt;/code&gt; file, you might encounter vulnerabilities when running &lt;code&gt;npm audit&lt;/code&gt; or &lt;code&gt;yarn audit&lt;/code&gt;. These vulnerabilities pose a security risk and need to be addressed promptly. This article will guide you through resolving vulnerabilities, particularly in React.js-based projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Vulnerabilities
&lt;/h2&gt;

&lt;p&gt;Vulnerabilities refer to flaws or weaknesses in a software system that attackers can exploit to undermine the system's integrity, availability, or confidentiality. These can emerge from outdated packages, insecure configurations, or flawed code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resolving Vulnerabilities in Direct Dependencies
&lt;/h2&gt;

&lt;p&gt;Direct dependencies (or devDependencies) are the packages that your project directly relies on. Here’s how you can address vulnerabilities in your React.js, Angular, or Vue.js applications:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Identify Vulnerabilities:&lt;/strong&gt; Execute &lt;code&gt;npm audit&lt;/code&gt; or &lt;code&gt;yarn audit&lt;/code&gt; to uncover any vulnerabilities within your project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Assess Breaking Changes:&lt;/strong&gt; Before updating any packages, verify whether there are breaking changes in the newer versions. Review the release notes of the packages or use &lt;code&gt;npm outdated&lt;/code&gt; or &lt;code&gt;yarn outdated&lt;/code&gt; to identify any significant changes that could impact your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Update Packages:&lt;/strong&gt; After evaluating for breaking changes, rectify the vulnerabilities by executing &lt;code&gt;npm audit fix&lt;/code&gt; or &lt;code&gt;yarn audit fix&lt;/code&gt;. This will typically upgrade the packages to the latest versions, thereby resolving the security issues. If you want to update a specific package, you can use &lt;code&gt;npm install package-name@latest&lt;/code&gt; or &lt;code&gt;yarn add package-name@latest&lt;/code&gt;. &lt;strong&gt;Note:&lt;/strong&gt; Avoid using &lt;code&gt;npm audit fix --force&lt;/code&gt; or &lt;code&gt;yarn audit fix --force&lt;/code&gt; as it can sometimes lead to downgrading packages, which might introduce new vulnerabilities. In such cases, it's better to manually update the packages by specifying the version in the &lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automate Security Checks:&lt;/strong&gt; Incorporate vulnerability checks into your CI/CD pipeline by using &lt;code&gt;npm audit&lt;/code&gt; or &lt;code&gt;yarn audit&lt;/code&gt; and configure the pipeline to fail if vulnerabilities are detected. Additionally, tools like &lt;code&gt;npm audit fix&lt;/code&gt; or &lt;code&gt;yarn audit fix&lt;/code&gt; can be employed to automatically correct vulnerabilities, streamlining the maintenance of your project's security.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Resolving Vulnerabilities in Indirect Dependencies
&lt;/h2&gt;

&lt;p&gt;Vulnerabilities can also occur in indirect (or transitive) dependencies, which are packages that your direct dependencies require. These vulnerabilities need careful handling to avoid breaking your project. Here’s how to deal with vulnerabilities in indirect dependencies effectively:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Identify Indirect Vulnerabilities:&lt;/strong&gt; Run &lt;code&gt;npm audit&lt;/code&gt; or &lt;code&gt;yarn audit&lt;/code&gt;. These commands help in identifying both direct and indirect dependency vulnerabilities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Analyze the Dependency Tree:&lt;/strong&gt; Use &lt;code&gt;npm ls &amp;lt;package_name&amp;gt;&lt;/code&gt; or &lt;code&gt;yarn list --pattern &amp;lt;package_name&amp;gt;&lt;/code&gt; to understand the dependency chain. This helps in pinpointing which direct dependencies are causing the indirect vulnerabilities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Update Direct Dependencies:&lt;/strong&gt; Often, updating your project's direct dependencies can also update the indirect ones, resolving vulnerabilities. Follow the general update procedures as outlined in previous sections.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Manual Updates for Indirect Dependencies:&lt;/strong&gt; If direct updates don't resolve the issues, you can manually update indirect dependencies in &lt;code&gt;Node.js v16.14.2 or later&lt;/code&gt; and &lt;code&gt;npm v8.3.0 or later&lt;/code&gt;. Add &lt;code&gt;overrides&lt;/code&gt; field in your &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"overrides"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
       &lt;/span&gt;&lt;span class="nl"&gt;"semver"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"6.3.1"&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After specifying the override, run &lt;code&gt;npm install&lt;/code&gt; or &lt;code&gt;yarn install&lt;/code&gt;. This modification forces all uses of the semver package to the specified version, potentially resolving the vulnerabilities. However, ensure compatibility as this may lead to issues if the updated version is incompatible with other dependencies.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Specifying Overrides for Specific Packages:&lt;/strong&gt; If you need to target a specific package for the update, you might add a more targeted override in your &lt;code&gt;package.json&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"overrides"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
       &lt;/span&gt;&lt;span class="nl"&gt;"@vitejs/plugin-react"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"semver"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"6.3.1"&lt;/span&gt;&lt;span class="w"&gt;
       &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures that only &lt;code&gt;@vitejs/plugin-react&lt;/code&gt; uses the specified version of &lt;code&gt;semver&lt;/code&gt;. Implement this, then run &lt;code&gt;npm install&lt;/code&gt; or &lt;code&gt;yarn install&lt;/code&gt; to apply the changes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD Integration:&lt;/strong&gt; Even if your CI/CD pipeline operates under &lt;code&gt;Node.js version 14&lt;/code&gt;, you can address vulnerabilities in indirect dependencies by leveraging the &lt;code&gt;overrides&lt;/code&gt; feature. First, ensure that you have &lt;code&gt;Node.js version ^16.14.0&lt;/code&gt; locally. Then, add the necessary overrides to your &lt;code&gt;package.json&lt;/code&gt; and run &lt;code&gt;npm install&lt;/code&gt;. This process should generate an updated &lt;code&gt;package-lock.json&lt;/code&gt; file reflecting the changes. In your CI/CD pipeline, utilize the &lt;code&gt;package-lock.json&lt;/code&gt; file from your local development environment to install dependencies. Execute the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm ci
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This specific command ensures that your project installs dependencies exactly as defined in your &lt;code&gt;package-lock.json&lt;/code&gt;, applying the overrides as intended and maintaining consistency across environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's crucial to thoroughly test your application after making these changes to ensure everything works correctly and the vulnerabilities are resolved.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices for Security Maintenance
&lt;/h2&gt;

&lt;p&gt;Enhance the security of your front-end applications with these straightforward practices:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Update Packages Regularly:&lt;/strong&gt; Always use the latest versions of your packages to benefit from recent security updates. Consistent updates prevent compatibility issues and reduce security risks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automate Security:&lt;/strong&gt; Implement automated security scans within your CI/CD pipeline. Early detection of vulnerabilities helps in their quick resolution, keeping your production environment secure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Utilize Security Tools:&lt;/strong&gt; Employ tools like &lt;code&gt;npm audit&lt;/code&gt; or &lt;code&gt;yarn audit&lt;/code&gt; to find and address vulnerabilities. Tools such as &lt;a href="https://snyk.io/" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;SNYK&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; or &lt;code&gt;npm audit fix&lt;/code&gt; can help automate the fixing process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Specify Exact Versions:&lt;/strong&gt; When adding packages, use the &lt;code&gt;--save-exact&lt;/code&gt; flag with &lt;code&gt;npm install&lt;/code&gt; or &lt;code&gt;yarn add&lt;/code&gt; to &lt;strong&gt;lock&lt;/strong&gt; the versions. This prevents unintended updates and maintains consistency, reducing the likelihood of introducing vulnerabilities.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Vulnerabilities in front-end applications represent considerable security threats. However, by adhering to the guidelines provided in this article, you can effectively mitigate these risks in your React.js, Angular, or Vue.js projects. Regular updates to your packages and the integration of automated security checks into your CI/CD processes are crucial steps in preserving the security and integrity of your applications. Stay proactive in your security practices to ensure a safer web environment for all users.&lt;/p&gt;

&lt;p&gt;Personal website:&lt;a href="https://utk09.com/blogs/resolve-vulnerabilities-in-frontend-apps" rel="noopener noreferrer"&gt;utk09.com&lt;/a&gt; | I write tutorials and blogs :)&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>vulnerabilities</category>
      <category>security</category>
    </item>
  </channel>
</rss>
