[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# Custom Build script not working

22 views · 0 likes · 2 posts


Xenonpy (@xenonpy) · 2024-08-01

<!-- Be sure to include all detail needed to let others see the same problem -->
So I have a custom build script to add a 404 html file, as my React Router 404 doesn't work with Vercel (it works locally). I tested it on my end and it creates the `404.html` just as required for a custom 404 in the docs. But it still shows the default 404 page. Here's my script: 

```sh
#!/bin/bash
bun run build
cd dist
echo "
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Error 404</title>
</head>
<body>
    <style>
        .notFoundContainer {
            width:100%;
            height:100%;
            display:flex;
            flex-direction: column;
             align-items:center;
            justify-content:center;
        }
    </style>
    <div className="notFoundContainer">
        <h1>404. Looks like this page is missing.</h1>
        <p>This can happen for a number of reasons, including a typo in the URL, a broken/outdated link, or a typo on our end.</p>
    </div>
</body>
</html>
" > 404.html
```


Pauline P. Narvas (@pawlean) · 2024-08-02

Hi and welcome, @xenonpy!

We have a guide on customising your 404 page. Might be helpful :smiley: 

https://vercel.com/guides/custom-404-page