electh / ReactFlux

A Simple but Powerful RSS Reader for Miniflux
https://reactflux.pages.dev
MIT License
224 stars 65 forks source link

Wont build on Cloudflare Worker with latest commits #124

Open solarisfire opened 3 weeks ago

solarisfire commented 3 weeks ago

Describe the Bug

Build log:

09:24:18.054 | Cloning repository...
-- | --
09:24:19.072 | From https://github.com/solarisfire/ReactFlux
09:24:19.073 | * branch            ea4fd40a9ea3b3c7faff1a042561d808616cf471 -> FETCH_HEAD
09:24:19.073 |  
09:24:19.121 | HEAD is now at ea4fd40 Deploying to gh-pages from @ solarisfire/ReactFlux@488c9ed64b7a1e89ad9aaead6e69a501b9ee749c 🚀
09:24:19.121 |  
09:24:19.206 |  
09:24:19.207 | Using v2 root directory strategy
09:24:19.232 | Success: Finished cloning repository files
09:24:20.828 | Checking for configuration in a wrangler.toml configuration file (BETA)
09:24:20.829 |  
09:24:20.929 | No wrangler.toml file found. Continuing.
09:24:21.075 | Detected the following tools from environment:
09:24:21.076 | Executing user command: npm run build
09:24:21.853 | npm ERR! code ENOENT
09:24:21.854 | npm ERR! syscall open
09:24:21.854 | npm ERR! path /opt/buildhome/repo/package.json
09:24:21.854 | npm ERR! errno -2
09:24:21.855 | npm ERR! enoent ENOENT: no such file or directory, open '/opt/buildhome/repo/package.json'
09:24:21.856 | npm ERR! enoent This is related to npm not being able to find a file.
09:24:21.856 | npm ERR! enoent
09:24:21.857 |  
09:24:21.857 | npm ERR! A complete log of this run can be found in: /opt/buildhome/.npm/_logs/2024-11-04T09_24_21_797Z-debug-0.log
09:24:21.864 | Failed: Error while executing user command. Exited with error code: 254
09:24:21.872 | Failed: build command exited with code: 1
09:24:22.719 | Failed: error occurred while running build command

Steps to Reproduce

Deploy on Cloudflare workers

Expected Behavior

Successful deployment

Screenshots / Videos

No response

ReactFlux Version

488c9ed

Miniflux Version

2.2.2 - 051bdec

Browser

N/A

Operating System

N/A

Device

N/A

Console Errors

No response

Additional Context

No response

NekoAria commented 3 weeks ago

Based on the provided logs, it seems you're encountering this issue while trying to deploy via Cloudflare Workers using the gh-pages branch. The error occurs because there's no wrangler.toml configuration file, causing it to default to running npm run build. This is where the problem lies.

While I haven't personally deployed ReactFlux using Cloudflare Workers, so I can't provide specific guidance there, I would suggest that Cloudflare Pages might be a better solution for static websites or SPAs. Here's why:

  1. Simpler Deployment Process

    • Direct GitHub repository integration

    • Automatic build and deployment without additional configuration

    • No Worker code required

  2. More Out-of-the-Box Features

    • Automatic HTTPS

    • Optimized caching

    • Built-in build system

    • Automatic preview deployments

    • Custom domain support

  3. Cost Benefits

    • More generous free tier

    • Doesn't consume Workers quota

    • Better suited for static content delivery

  4. Performance Benefits

    • Optimized for static content

    • Global CDN distribution

    • Automatic edge caching

You might want to consider Workers only if you have specific requirements such as:

Recommendation: Deploy ReactFlux directly using Cloudflare Pages for a significantly streamlined deployment process.