<?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: Marcus Magalhães</title>
    <description>The latest articles on DEV Community by Marcus Magalhães (@marcusmagalhaes).</description>
    <link>https://dev.to/marcusmagalhaes</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%2F2837700%2F90ce7e30-d41a-4ecc-a122-301037362370.jpeg</url>
      <title>DEV Community: Marcus Magalhães</title>
      <link>https://dev.to/marcusmagalhaes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marcusmagalhaes"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Marcus Magalhães</dc:creator>
      <pubDate>Sun, 09 Feb 2025 13:51:28 +0000</pubDate>
      <link>https://dev.to/marcusmagalhaes/-4m10</link>
      <guid>https://dev.to/marcusmagalhaes/-4m10</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/marcusmagalhaes" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F2837700%2F90ce7e30-d41a-4ecc-a122-301037362370.jpeg" alt="marcusmagalhaes"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/marcusmagalhaes/error-when-running-nextjs-cannot-find-module-nextdistcompiledws-34b8" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Error when running Next.js: "Cannot find module 'next/dist/compiled/ws'"&lt;/h2&gt;
      &lt;h3&gt;Marcus Magalhães ・ Feb 9&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#nextjs&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#react&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#typescript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#npm&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>nextjs</category>
      <category>react</category>
      <category>typescript</category>
      <category>npm</category>
    </item>
    <item>
      <title>Error when running Next.js: "Cannot find module 'next/dist/compiled/ws'"</title>
      <dc:creator>Marcus Magalhães</dc:creator>
      <pubDate>Sun, 09 Feb 2025 13:31:32 +0000</pubDate>
      <link>https://dev.to/marcusmagalhaes/error-when-running-nextjs-cannot-find-module-nextdistcompiledws-34b8</link>
      <guid>https://dev.to/marcusmagalhaes/error-when-running-nextjs-cannot-find-module-nextdistcompiledws-34b8</guid>
      <description>&lt;p&gt;*&lt;em&gt;When I try to run the &lt;code&gt;npm run dev&lt;/code&gt; command, I get the following error:&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Error: Cannot find module 'next/dist/compiled/ws' Require stack:
  /mnt/c/Users/Marcus Flavio/OneDrive - Microsoft 365/Área de Trabalho/Projects/smartiming-pwa/node_modules/next/dist/server/dev/hot-reloader-webpack.js
  /mnt/c/Users/Marcus Flavio/OneDrive - Microsoft 365/Área de Trabalho/Projects/smartiming-pwa/node_modules/next/dist/server/lib/router-utils/setup-dev-bundler.js
  /mnt/c/Users/Marcus Flavio/OneDrive - Microsoft 365/Área de Trabalho/Projects/smartiming-pwa/node_modules/next/dist/server/lib/router-server.js
  /mnt/c/Users/Marcus Flavio/OneDrive - Microsoft 365/Área de Trabalho/Projects/smartiming-pwa/node_modules/next/dist/server/lib/start-server.js
] { code: 'MODULE_NOT_FOUND', requireStack: [Array] }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;next.config.js file configuration:&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const withPWA = require("@ducanh2912/next-pwa").default({
    dest: "public",
    cacheOnFrontEndNav: true,
    aggressiveFrontEndNavCaching: true,
    reloadOnOnline: true,
    swcMinify: true,
    disable: process.env.NODE_ENV === "development",
    workboxOptions: {
        disableDevLogs: true,
    },
    swSrc: "public/serviceWorker.js",
});

/** @type {import('next').NextConfig} */
const nextConfig = {
    typescript: {
        tsconfigPath: "./tsconfig.json",
    },
    images: {
        remotePatterns: [
            {
                protocol: "https",
                hostname: "**.**.**",
            },
        ],
    },

    webpack(config) {
        config.resolve.alias = {
            ...config.resolve.alias,
            "@": require("path").resolve(__dirname),
        };
        return config;
    },
};

module.exports = withPWA(nextConfig);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Development environment&lt;/strong&gt;&lt;br&gt;
System: &lt;strong&gt;WSL on Windows&lt;/strong&gt;&lt;br&gt;
Node.js: &lt;strong&gt;v22.13.1&lt;/strong&gt;&lt;br&gt;
Next.js: &lt;strong&gt;v15.1.6&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Troubleshooting steps taken:&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
1- Added experimental configuration in &lt;code&gt;next.config.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;experimental: {
   outputFileTracingRoot: join(__dirname, '../../'),
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2- Cleared cache and removed temporary directories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rf .next &amp;amp;&amp;amp; npm cache clean --force

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3- Removed&lt;code&gt;node_modules&lt;/code&gt; and&lt;code&gt;package-lock.json&lt;/code&gt;and reinstalled dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rf node_modules package-lock.json
npm install

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;None of these solutions worked. Has anyone faced this error or has suggestions?&lt;br&gt;
*&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>typescript</category>
      <category>npm</category>
    </item>
  </channel>
</rss>
