title: Sentry.io on Next.Js + Serverless: Module not found: Error: Can't resolve 'webpack'
body: <p>After adding Sentry.io with the automatic wizard (it added <code>&quot;@sentry/nextjs&quot;: &quot;^6.11.0&quot;</code> in <code>package.json</code>), I can't build my Next.js project anymore.</p>
  <pre><code>&gt; npm run build
  (...)
  Error: Command failed with exit code 1: node_modules/.bin/next build
  warn  - No ESLint configuration detected. Run next lint to begin setup
  Failed to compile.
  ModuleNotFoundError: Module not found: Error: Can't resolve 'webpack' in '/builds/group/project/web/node_modules/@next/react-refresh-utils'
  (...)
  info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
  </code></pre>
  <p>I tried to <code>npm install --save-dev webpack</code> but I'm running in other errors like</p>
  <pre><code>./node_modules/fsevents/fsevents.node
  Module parse failed: Unexpected character '�' (1:0)
  </code></pre>
  <p>How can I fix this?</p>
  <p>[EDIT]
  I also use Serverless component <code>@sls-next/serverless-component@3.2.0</code> to deploy on AWS.
  My next.config.js contains:</p>
  <pre><code>const moduleExports = { target: 'serverless' };
  </code></pre>