DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk5 min

How to Troubleshoot JavaScript Files That Return 404 After Deployment

A JavaScript bundle 404 and a client-side route 404 need different fixes. Use the failed URL to check build files, deployment paths, host fallbacks, and release caching.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A 404 after deployment can mean either a missing JavaScript bundle or a page route your server does not know how to serve. Find the exact failed URL first: a missing .js file calls for checking build output and asset paths; a failed route such as /dashboard usually needs a correctly scoped single-page-app fallback.

1. Identify what returned 404

Open your browser’s developer tools and inspect the failed request in the Network panel. Record its full path, status, any redirect, and response type.

  • If the URL ends in a JavaScript filename, such as /assets/app-abc123.js, troubleshoot the asset path and deployed files.
  • If the URL is an application page such as /dashboard, and in-app navigation works but direct opening or refreshing fails, troubleshoot server-side routing.

These failures can look similar in the browser, but a route rewrite will not restore a JavaScript file that is absent from the deployment.

2. Check the build output and publish directory

Run the project’s production build, then inspect the generated output directory for the requested JavaScript file. Check that your hosting provider is publishing that same directory. Netlify notes that dist is common but depends on the framework; Vercel warns that a mismatched output directory can leave an empty folder being served. See Netlify’s build configuration guidance and Vercel’s build configuration documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
  1. Run the project’s production build command.
  2. Locate the generated JavaScript file in the output directory.
  3. Compare the output directory with the host’s configured publish or output directory.
  4. Compare the deployed HTML’s script URL with the file’s path in the deployed output.

If the file is missing from the build itself, investigate the build configuration or imports. If it exists locally but not in the deployed output, check the publish directory and the deployment contents.

3. Match asset paths to the deployment location

An app deployed under a subdirectory needs its generated asset URLs to include that prefix. A bundle requested from /assets/ will not be found if the deployed app actually serves it beneath /my-app/assets/, for example.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Set the framework’s base or public path to match the location where the app is served. Vue CLI documents setting publicPath for deployment location; its GitHub Pages example uses /<REPO>/ for a project deployed at https://<USERNAME>.github.io/<REPO>/. TanStack Router’s Vite guidance likewise covers matching the base setting to a subdirectory. See Vue CLI deployment guidance and TanStack Router’s production guide.

After changing the path setting, rebuild and deploy again; changing it only in development does not update already-generated HTML or bundles.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

4. Add a fallback for client-side routes

With history-based routing, client-side navigation can change the browser URL without requesting a new page from the server. When someone opens that URL directly or refreshes it, however, the host receives a request for the route. If no corresponding server file or fallback exists, it returns 404.

Configure the host to serve index.html for application routes. Netlify says history-based SPAs need a rewrite to serve index.html for requested URLs; see Netlify’s file-based configuration documentation. Vercel’s guidance shows a catch-all rewrite for Vite/Create React App-style SPAs, while noting that API paths may require exclusion; the generic rewrite is not appropriate for every framework. See Vercel’s routing guidance.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Keep the fallback scoped to navigation routes. A broad catch-all can mask missing static files or send API requests to the app’s HTML instead of the intended response. Frameworks and hosts differ, so use the routing configuration intended for your stack rather than assuming one rewrite rule works everywhere. Vue CLI also notes that history-mode routing requires the production server to fall back to index.html.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

5. Check release and cache mismatches

After a deployment, inspect the script URLs in the active HTML and compare their hashed filenames with the JavaScript files in the active deployment. If the HTML references a new hash that is not present, or an older cached HTML page points to a file that has since disappeared, requests can fail even when the build is otherwise correct.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Netlify warns that changing hashed filenames can break references across atomic deploys. Azure Static Web Apps says deployment cache invalidation is automatic, but browsers and separately configured CDNs can still cache content. See Netlify’s deployment configuration documentation and the Azure Static Web Apps FAQ.

  • Check whether a hard reload or a fresh browser session changes the result.
  • If you use a separate CDN, inspect its cache behavior for both HTML and JavaScript assets.
  • Verify that the active release contains the exact bundle names referenced by the HTML it serves.

Do not treat a cache purge as the fix until you have confirmed the referenced bundle exists in the active deployment.

6. Separate custom-domain problems from deployment problems

If the platform’s deployment URL works but the custom domain fails, investigate the domain and DNS configuration rather than changing the bundle path or SPA fallback first. Vercel recommends comparing the deployment URL with the custom domain when diagnosing this kind of issue. On other hosts, make the equivalent comparison, but do not assume their domain routing behaves identically. See Vercel’s domain troubleshooting documentation.

Platform-specific checks

Platform or framework What to verify Relevant guidance
Netlify Publish directory matches production build output; history-based SPA routes rewrite to index.html; hashed bundle references remain available across deploys. Build configuration and file-based configuration
Vercel Output directory and routing match the framework; a generic SPA rewrite may need to exclude API paths and may not fit every framework. Build configuration and routing guidance
Vue CLI Set publicPath for root or subdirectory deployment; history-mode routes need a production-server fallback. Vue CLI is in maintenance mode, so newer Vue projects should check current tooling guidance. Deployment guide
TanStack Router with Vite Align Vite’s base, build output directory, and static-file serving with the deployed location. Production guide
Azure Static Web Apps Add a fallback for client-side routes that do not correspond to deployed files; account for browser or separately configured CDN caches. FAQ
Cloudflare Workers static assets Review SPA not-found behavior and navigation/API handling before serving /index.html for unmatched navigation requests. SPA routing documentation

Use the symptom to choose the next fix

What you see First place to investigate Next check
A .js bundle URL returns 404 Asset path, missing build file, output directory, or stale bundle reference Compare the requested URL with both build output and deployed files; verify the deployment prefix.
In-app navigation works, but direct route opening or refresh returns 404 Server or platform does not know the client-side route Configure a host-appropriate fallback to index.html for application routes.
Failure began after a release, particularly for hashed chunks HTML and bundle references may not match the active release; browser or CDN cache may also be involved Compare the HTML-referenced hash with deployed files and check cache behavior.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.