wrangler-action icon indicating copy to clipboard operation
wrangler-action copied to clipboard

Missing entry-point

Open dapperdandev opened this issue 7 months ago • 5 comments

  ✘ [ERROR] Missing entry-point to Worker script or to assets directory
    
    If there is code to deploy, you can either:
    - Specify an entry-point to your Worker script via the command line (ex: `npx wrangler versions upload src/index.ts`)
    - Or create a "wrangler.jsonc" file containing:
    
    {
      "name": "worker-name",
      "compatibility_date": "2025-05-28",
      "main": "src/index.ts"
    }

This is in the root of my project:

// wrangler.jsonc
{
    "name": "exp",
    "compatibility_date": "2025-05-28",
    "assets": {
        "directory": "./dist"
    }
}

This is my action:

            - name: Upload Worker Version
              uses: cloudflare/wrangler-action@v3
              with:
                  apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
                  wranglerVersion: "4.17.0"
                  accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
                  command: versions upload --tag=${{ env.VERSION }}

I'm following the migration from pages -> workers guide: https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/#project-configuration.

Based on the documentation and from making this work locally, I shouldn't need the main/entrypoint since I didn't have any functions. It's just a static web app.

dapperdandev avatar May 28 '25 16:05 dapperdandev

Looks like it won't work until v4 action is released. I'm using CLI instead:

      - run: npm i -D wrangler@4
      - run: npx wrangler deploy
        env:
          CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

megahertz avatar Jul 02 '25 08:07 megahertz

Still an issue. Can't figure out a work around except using the CLI directly:

deploy:
    runs-on: ubuntu-latest
    needs: test
    timeout-minutes: 60
    name: Deploy
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "latest"
          cache: "npm"

      - name: Install dependencies
        run: npm ci

      - name: Deploy
        run: npm run deploy
        env:
          CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

sleeyax avatar Aug 02 '25 17:08 sleeyax

Ran into this myself. Megahertz' solution worked for me

olsonpm avatar Aug 25 '25 23:08 olsonpm

Still an issue, seems that this action doesn't work if you're only deploying static assets

RichardoC avatar Aug 26 '25 15:08 RichardoC

To deploy static assets (in this case generated by 11ty) using cloudflare workers and without specifying an entry point the following worked for me (using wrangler 4.34.0)

  1. Added the following wrangler.jsonc file
{
  "name": "project-name-here",
  "compatibility_date": "2025-09-08",
    "assets": {
      "directory": "./_site"
    }
}

~~2. Removed output directory _site/ from .gitignore~~

My workflow is serving / building site locally with npx @11ty/eleventy --serve then ~~pushing changes to repo to trigger build~~ deploying to prod with npx wrangler deploy. Output/assets directory is specific to 11ty but if you're using another framework then updating to your relevant output/assets directory should work as well.

tjgilpin avatar Sep 08 '25 13:09 tjgilpin