<?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: Paulo</title>
    <description>The latest articles on DEV Community by Paulo (@paulovarassin).</description>
    <link>https://dev.to/paulovarassin</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4132913%2F2d933980-ec6c-4314-88ec-2843296ea24c.png</url>
      <title>DEV Community: Paulo</title>
      <link>https://dev.to/paulovarassin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paulovarassin"/>
    <language>en</language>
    <item>
      <title>Fixing a Next.js 16 deployment on Hostinger: glibc, SWC, and Webpack</title>
      <dc:creator>Paulo</dc:creator>
      <pubDate>Sat, 19 Sep 2026 13:03:29 +0000</pubDate>
      <link>https://dev.to/paulovarassin/fixing-a-nextjs-16-deployment-on-hostinger-glibc-swc-and-webpack-278h</link>
      <guid>https://dev.to/paulovarassin/fixing-a-nextjs-16-deployment-on-hostinger-glibc-swc-and-webpack-278h</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Errors encountered during deployment:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/lib64/libm.so.6: version `GLIBC_2.29' not found
Failed to load next.config.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After switching the configuration to JavaScript, the remaining error was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Only WebAssembly (WASM) bindings were loaded,
and Turbopack requires native bindings.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The fix that worked for mine Next.js 16.3.5 deployment:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Rename &lt;code&gt;next.config.ts&lt;/code&gt; to &lt;code&gt;next.config.mjs&lt;/code&gt;. Remove the TypeScript type import
and replace &lt;code&gt;const nextConfig: NextConfig =&lt;/code&gt; with &lt;code&gt;const nextConfig =&lt;/code&gt;.
Preserve all existing settings and &lt;code&gt;export default nextConfig&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Change the build script in &lt;code&gt;package.json&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;   - "build": "next build",
   + "build": "next build --webpack",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Commit and push both changes, then redeploy. Keep Hostinger's build command
as &lt;code&gt;npm run build&lt;/code&gt;, output directory as &lt;code&gt;.next&lt;/code&gt;, and Node.js selection as &lt;code&gt;22.x&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;code&gt;.mjs&lt;/code&gt; configuration avoids TypeScript transformation during configuration&lt;br&gt;
loading. Webpack allows the build to proceed with the available SWC WASM fallback.&lt;br&gt;
No &lt;code&gt;webpack: true&lt;/code&gt; setting, Next.js downgrade, or manual glibc upgrade was needed.&lt;/p&gt;
&lt;h2&gt;
  
  
  How the issue unfolded
&lt;/h2&gt;

&lt;p&gt;While deploying the website to Hostinger, I ran into a build failure that initially looked like a broken Next.js configuration file.&lt;/p&gt;

&lt;p&gt;The project built locally. On Hostinger, the log mentioned a missing temporary configuration module, along with an error about &lt;code&gt;GLIBC_2.29&lt;/code&gt;. Changing the configuration format got the build further, but it took a second change to get past the actual compiler limitation.&lt;/p&gt;

&lt;p&gt;The working combination was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;next.config.mjs&lt;/code&gt; instead of &lt;code&gt;next.config.ts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run the production build with &lt;code&gt;next build --webpack&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is how the errors led to those changes.&lt;/p&gt;
&lt;h2&gt;
  
  
  The environment
&lt;/h2&gt;

&lt;p&gt;The website uses Next.js App Router, TypeScript, React, and CSS Modules. The relevant versions and deployment settings were:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Next.js&lt;/td&gt;
&lt;td&gt;16.3.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;React&lt;/td&gt;
&lt;td&gt;19.2.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local operating system&lt;/td&gt;
&lt;td&gt;Windows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local Node.js&lt;/td&gt;
&lt;td&gt;22.20.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local npm&lt;/td&gt;
&lt;td&gt;11.6.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hostinger Node.js selection&lt;/td&gt;
&lt;td&gt;22.x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hostinger build command&lt;/td&gt;
&lt;td&gt;&lt;code&gt;npm run build&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root directory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;./&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output directory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.next&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The exact Node.js patch version and npm version used by the remote builder were not established. The versions above distinguish what was checked locally from what was selected in Hostinger's deployment panel.&lt;/p&gt;
&lt;h2&gt;
  
  
  The first failure: configuration loading
&lt;/h2&gt;

&lt;p&gt;The original build attempted to load &lt;code&gt;next.config.ts&lt;/code&gt; and failed. These were the useful parts of the log, with account-specific paths omitted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Attempted to load @next/swc-linux-x64-gnu
/lib64/libm.so.6: version `GLIBC_2.29' not found

Attempted to load @next/swc-linux-x64-musl
/lib64/libc.so: invalid ELF header

Failed to load next.config.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A later message referred to a missing generated configuration module. Hostinger's automated analysis suggested deleting a corrupted temporary configuration file.&lt;/p&gt;

&lt;p&gt;That explanation did not account for the earlier native-library errors. A generated filename alone was not evidence that the configuration had become corrupted, and clearing the Next.js cache would not provide the missing system-library interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a TypeScript project was complaining about Linux libraries
&lt;/h2&gt;

&lt;p&gt;SWC is the compiler used by Next.js to transform application code. Its native binaries depend on the operating system they run on.&lt;/p&gt;

&lt;p&gt;glibc is the GNU C Library, a foundational library used by many Linux programs. The reported failure involved its math library, &lt;code&gt;libm.so.6&lt;/code&gt;. The SWC binary needed the versioned interface named &lt;code&gt;GLIBC_2.29&lt;/code&gt;, which the loaded library did not provide.&lt;/p&gt;

&lt;p&gt;I connected through SSH and ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;getconf GNU_LIBC_VERSION
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;glibc 2.28
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This confirmed the library version in the SSH session. It did not prove that the deployment builder and SSH session were identical environments, but the build log independently confirmed the missing interface in the builder.&lt;/p&gt;

&lt;p&gt;Neither changing the project's npm dependencies nor selecting a newer Node.js version necessarily upgrades the Linux libraries underneath them. Manually replacing glibc in a managed hosting account was not an appropriate fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  First change: load the configuration as JavaScript
&lt;/h2&gt;

&lt;p&gt;I converted &lt;code&gt;next.config.ts&lt;/code&gt; to &lt;code&gt;next.config.mjs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The opening lines changed from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NextConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nextConfig&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NextConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Existing settings&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;nextConfig&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to:&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="cm"&gt;/** @type {import("next").NextConfig} */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nextConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Existing settings, unchanged&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;nextConfig&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are excerpts illustrating the conversion. I preserved the real configuration body, including its security headers and conditional Docker output setting.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.mjs&lt;/code&gt; extension identifies a JavaScript module that Node.js can load without transforming TypeScript syntax. The JSDoc comment retains editor type information. Next.js supports this configuration format. &lt;a href="https://nextjs.org/docs/app/api-reference/config/next-config-js" rel="noopener noreferrer"&gt;Next.js configuration documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Only the configuration file changed language. The application remained TypeScript.&lt;/p&gt;

&lt;p&gt;After committing and pushing the rename, the next deployment confirmed that this step worked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✓ Running next.config.mjs took 27ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The second failure made the remaining problem clearer
&lt;/h2&gt;

&lt;p&gt;Configuration loading succeeded, but the production build still failed. This time the log showed that Next.js had selected the WebAssembly fallback for SWC:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Using cached swc package @next/swc-wasm-nodejs...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It then explained the limitation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Turbopack is not supported on this platform (linux/x64)
because native bindings are not available.
Only WebAssembly (WASM) bindings were loaded,
and Turbopack requires native bindings.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Turbopack and Webpack are bundlers: they assemble application code and assets into build output. In this deployment, Next.js was using Turbopack, which could not operate with the available WASM bindings. The error explicitly recommended switching to Webpack. &lt;a href="https://nextjs.org/docs/app/api-reference/turbopack#supported-platforms" rel="noopener noreferrer"&gt;Turbopack documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This also explained why changing the configuration extension was only part of the solution. It removed the first obstacle without changing the bundler used for the rest of the build.&lt;/p&gt;

&lt;h2&gt;
  
  
  Second change: select Webpack in the build command
&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;package.json&lt;/code&gt;, I changed one script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;- "build": "next build",
&lt;/span&gt;&lt;span class="gi"&gt;+ "build": "next build --webpack",
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final scripts were:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&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;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"next dev"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"next build --webpack"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"next start"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"lint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eslint ."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"typecheck"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"next typegen &amp;amp;&amp;amp; tsc --noEmit"&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;&lt;code&gt;--webpack&lt;/code&gt; is the supported CLI option for selecting Webpack. A suggestion from the automated analysis to add &lt;code&gt;webpack: true&lt;/code&gt; to the configuration was incorrect: that configuration property is a customization hook, not a boolean bundler selector. &lt;a href="https://nextjs.org/docs/app/api-reference/cli/next" rel="noopener noreferrer"&gt;Next.js CLI documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I kept Hostinger's build command as &lt;code&gt;npm run build&lt;/code&gt;; it now invoked the updated script. The output directory stayed &lt;code&gt;.next&lt;/code&gt;, and Node.js stayed at 22.x. Local development continued to use the default bundler through &lt;code&gt;next dev&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There was no need to install Webpack separately, downgrade Next.js, rewrite the application in JavaScript, or upgrade glibc manually.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validation and result
&lt;/h2&gt;

&lt;p&gt;Before redeploying, these checks passed locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run lint
npm run typecheck
npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The local production build identified the selected bundler as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;▲ Next.js 16.3.5 (webpack)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The local checks validated the project changes; they did not reproduce Hostinger's Linux environment. The subsequent Hostinger deployment worked after the changes were pushed and redeployed.&lt;/p&gt;

</description>
      <category>deployment</category>
      <category>javascript</category>
      <category>nextjs</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
