404 new React App

Hi Everyone, I usually use Netlify to host a simple static page but wanted to give Cloudflare Pages a try. When I deploy, it looks like a "success" in the build logs but when I visit the dev link https://00b12475.mooovers-web.pages.dev I get a 404.
7 Replies
Chaika
Chaika4mo ago
When you're looking at the Build logs, click on the Assets Uploaded tab. Do you have a top-level index.html? (Click "View Details" on the deployment -> Assets Uploaded) Magic link to Assets Uploaded: https://dash.cloudflare.com/?to=/:account/pages/view/:pages-project/:pages-deployment/files
Ken
Ken4mo ago
Hi Chaika, I do not see a top level index.html. It's in a subfolder "app"
File name
BUILD_ID
app-build-manifest.json
app-path-routes-manifest.json
build-manifest.json
export-marker.json
images-manifest.json
next-minimal-server.js.nft.json
next-server.js.nft.json
package.json
prerender-manifest.js
prerender-manifest.json
react-loadable-manifest.json
required-server-files.json
routes-manifest.json
trace

cache
.tsbuildinfo
config.json

eslint

webpack

server
app-paths-manifest.json
font-manifest.json
functions-config-manifest.json
middleware-build-manifest.js
middleware-manifest.json
middleware-react-loadable-manifest.js
next-font-manifest.js
next-font-manifest.json
pages-manifest.json
server-reference-manifest.js
server-reference-manifest.json
webpack-runtime.js

app
_not-found.html
_not-found.js
_not-found.js.nft.json
_not-found.meta
_not-found.rsc
_not-found_client-reference-manifest.js
favicon.ico.body
favicon.ico.meta
index.html
index.meta
index.rsc
page.js
page.js.nft.json
page_client-reference-manifest.js

favicon.ico

chunks

pages
404.html
500.html
_app.js
_app.js.nft.json
_document.js
_document.js.nft.json
_error.js
_error.js.nft.json

static

chunks

css

media

wcJh-JHbU9ZpY9aQI0HoC

types
package.json

app
layout.ts
page.ts
File name
BUILD_ID
app-build-manifest.json
app-path-routes-manifest.json
build-manifest.json
export-marker.json
images-manifest.json
next-minimal-server.js.nft.json
next-server.js.nft.json
package.json
prerender-manifest.js
prerender-manifest.json
react-loadable-manifest.json
required-server-files.json
routes-manifest.json
trace

cache
.tsbuildinfo
config.json

eslint

webpack

server
app-paths-manifest.json
font-manifest.json
functions-config-manifest.json
middleware-build-manifest.js
middleware-manifest.json
middleware-react-loadable-manifest.js
next-font-manifest.js
next-font-manifest.json
pages-manifest.json
server-reference-manifest.js
server-reference-manifest.json
webpack-runtime.js

app
_not-found.html
_not-found.js
_not-found.js.nft.json
_not-found.meta
_not-found.rsc
_not-found_client-reference-manifest.js
favicon.ico.body
favicon.ico.meta
index.html
index.meta
index.rsc
page.js
page.js.nft.json
page_client-reference-manifest.js

favicon.ico

chunks

pages
404.html
500.html
_app.js
_app.js.nft.json
_document.js
_document.js.nft.json
_error.js
_error.js.nft.json

static

chunks

css

media

wcJh-JHbU9ZpY9aQI0HoC

types
package.json

app
layout.ts
page.ts
Chaika
Chaika4mo ago
looks like it's in /server/app to me https://00b12475.mooovers-web.pages.dev/server/app/
Mooovers - Stock Market Calendar
Track Earnings, IPOs, and more.
Chaika
Chaika4mo ago
Under Settings -> builds & Deployments -> Build Configurations, you can edit your configuration and set your Build Output directory to server/app and then rerun the build
Ken
Ken4mo ago
I tried that, but the deployment failed
2024-04-03T01:01:00.34523Z Executing user command: npm run build
2024-04-03T01:01:00.918133Z
2024-04-03T01:01:00.918463Z > my-project@0.1.0 build
2024-04-03T01:01:00.918664Z > next build
2024-04-03T01:01:00.918758Z
2024-04-03T01:01:01.494324Z ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
2024-04-03T01:01:01.4987Z Attention: Next.js now collects completely anonymous telemetry regarding usage.
2024-04-03T01:01:01.498871Z This information is used to shape Next.js' roadmap and prioritize features.
2024-04-03T01:01:01.499035Z You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
2024-04-03T01:01:01.499157Z https://nextjs.org/telemetry
2024-04-03T01:01:01.499317Z
2024-04-03T01:01:01.596343Z ▲ Next.js 14.1.4
2024-04-03T01:01:01.596651Z
2024-04-03T01:01:01.655344Z Creating an optimized production build ...
2024-04-03T01:01:11.662252Z ✓ Compiled successfully
2024-04-03T01:01:11.663146Z Linting and checking validity of types ...
2024-04-03T01:01:13.87345Z Collecting page data ...
2024-04-03T01:01:15.00651Z Generating static pages (0/5) ...
2024-04-03T01:01:15.583921Z
Generating static pages (1/5)
2024-04-03T01:01:15.709021Z
Generating static pages (2/5)
2024-04-03T01:01:15.709318Z
Generating static pages (3/5)
2024-04-03T01:01:15.713027Z
✓ Generating static pages (5/5)
2024-04-03T01:01:16.177612Z Finalizing page optimization ...
2024-04-03T01:01:16.177872Z Collecting build traces ...
2024-04-03T01:01:21.223334Z
2024-04-03T01:01:21.226512Z Route (app) Size First Load JS
2024-04-03T01:01:21.226743Z ┌ ○ / 136 B 84.4 kB
2024-04-03T01:01:21.226837Z └ ○ /_not-found 885 B 85.2 kB
2024-04-03T01:01:21.22693Z + First Load JS shared by all 84.3 kB
2024-04-03T01:01:21.227049Z ├ chunks/69-1656e2cc92fa6e80.js 29.1 kB
2024-04-03T01:01:21.227175Z ├ chunks/fd9d1056-d03af0e963d7a2f3.js 53.4 kB
2024-04-03T01:01:21.227303Z └ other shared chunks (total) 1.86 kB
2024-04-03T01:01:21.227681Z
2024-04-03T01:01:21.227799Z
2024-04-03T01:01:21.228084Z ○ (Static) prerendered as static content
2024-04-03T01:01:21.228205Z
2024-04-03T01:01:21.274573Z Finished
2024-04-03T01:01:21.275431Z Note: No functions dir at /functions found. Skipping.
2024-04-03T01:01:21.275643Z Validating asset output directory
2024-04-03T01:01:21.275888Z Error: Output directory "server/app" not found.
2024-04-03T01:01:25.09199Z Failed: build output directory not found
2024-04-03T01:01:00.34523Z Executing user command: npm run build
2024-04-03T01:01:00.918133Z
2024-04-03T01:01:00.918463Z > my-project@0.1.0 build
2024-04-03T01:01:00.918664Z > next build
2024-04-03T01:01:00.918758Z
2024-04-03T01:01:01.494324Z ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
2024-04-03T01:01:01.4987Z Attention: Next.js now collects completely anonymous telemetry regarding usage.
2024-04-03T01:01:01.498871Z This information is used to shape Next.js' roadmap and prioritize features.
2024-04-03T01:01:01.499035Z You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
2024-04-03T01:01:01.499157Z https://nextjs.org/telemetry
2024-04-03T01:01:01.499317Z
2024-04-03T01:01:01.596343Z ▲ Next.js 14.1.4
2024-04-03T01:01:01.596651Z
2024-04-03T01:01:01.655344Z Creating an optimized production build ...
2024-04-03T01:01:11.662252Z ✓ Compiled successfully
2024-04-03T01:01:11.663146Z Linting and checking validity of types ...
2024-04-03T01:01:13.87345Z Collecting page data ...
2024-04-03T01:01:15.00651Z Generating static pages (0/5) ...
2024-04-03T01:01:15.583921Z
Generating static pages (1/5)
2024-04-03T01:01:15.709021Z
Generating static pages (2/5)
2024-04-03T01:01:15.709318Z
Generating static pages (3/5)
2024-04-03T01:01:15.713027Z
✓ Generating static pages (5/5)
2024-04-03T01:01:16.177612Z Finalizing page optimization ...
2024-04-03T01:01:16.177872Z Collecting build traces ...
2024-04-03T01:01:21.223334Z
2024-04-03T01:01:21.226512Z Route (app) Size First Load JS
2024-04-03T01:01:21.226743Z ┌ ○ / 136 B 84.4 kB
2024-04-03T01:01:21.226837Z └ ○ /_not-found 885 B 85.2 kB
2024-04-03T01:01:21.22693Z + First Load JS shared by all 84.3 kB
2024-04-03T01:01:21.227049Z ├ chunks/69-1656e2cc92fa6e80.js 29.1 kB
2024-04-03T01:01:21.227175Z ├ chunks/fd9d1056-d03af0e963d7a2f3.js 53.4 kB
2024-04-03T01:01:21.227303Z └ other shared chunks (total) 1.86 kB
2024-04-03T01:01:21.227681Z
2024-04-03T01:01:21.227799Z
2024-04-03T01:01:21.228084Z ○ (Static) prerendered as static content
2024-04-03T01:01:21.228205Z
2024-04-03T01:01:21.274573Z Finished
2024-04-03T01:01:21.275431Z Note: No functions dir at /functions found. Skipping.
2024-04-03T01:01:21.275643Z Validating asset output directory
2024-04-03T01:01:21.275888Z Error: Output directory "server/app" not found.
2024-04-03T01:01:25.09199Z Failed: build output directory not found
Could this be an issue with the domain instead?
Chaika
Chaika4mo ago
That's next.js, not exactly react no There's a build template for Next.js static html export, but doesn't support all features, some limitations like with wildcard paths and such. There's also next-on-pages: https://github.com/cloudflare/next-on-pages, which supports the Edge Runtime and some of those more advanced features
Ken
Ken4mo ago
Ohh I see, I should have mentioned that I don't do web dev often so I confused the two. Let me read that over, thank you!