Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Payload Cloud cache clear

default discord avatar
ingrid741last year
15

After a restructuring in my monorepo it seems my project uses stale cache on build and fails.



How do people clear their cache on Payload Cloud??



I've had to rollback some things and it seems my Payload Cache is stale again - will someone please cache clear Cloud for me? Thank you 🙏



ProjectId: 65ab7dfd9cd1b4cda482f61c



Let me know how I can do it as part of my build script if possible



@858693520012476436

I think you sorted this last time 🙏

  • discord user avatar
    seanzubrickas
    last year

    Hey

    @735059082293149777

    are you able to build locally? I am in your project now and it looks like all recent builds have failed

  • default discord avatar
    ingrid741last year

    Yep it builds fine locally

  • discord user avatar
    seanzubrickas
    last year

    Ok, can you check your settings on the Payload app in your repo? I am guessing you have it set to only provide access to the repo in question, but as I've just discovered I think there is a bug with our auth, to where if it is not set to all repos, our platform doesn't have permissions to trigger a redeploy



  • default discord avatar
    ingrid741last year

    Yes I have it set to only select

  • discord user avatar
    seanzubrickas
    last year

    Would you be able to set that to All for the purpose of this fix? Realistically—we (Payload cloud admin platform) cannot/would not interact with any other repos. This also only applies to repos that your personal github user account owns. If not, I am waiting for Elliot from our side to get back online in a few hours.



    And I'm betting this is related to the cache issue, because all the builds on our platform failed, likely due to it not having permissions for your repo

  • default discord avatar
    ingrid741last year

    Sorry I couldn't get back to you sooner - I did set it to "All" before and redeployed twice with the same result (fail) and didn't get the chance to notify of that here



    Still fails

  • discord user avatar
    seanzubrickas
    last year

    Ok—no worries! You can disregard this, as I was informed that the place I was attempting a redeploy only works if it's within a certain time period of when you deployed the project initially



    You can set it back to your select repo—and I will work on a redeploy for you in a moment!

    I am actually looking through the deploy logs now—it looks like the last successful deployment was 9/9—on 9/12, build failed, and never built successfully after that.

  • default discord avatar
    ingrid741last year

    That sounds about right



    So I'm working on and off on backend (payload) and frontends in a monorepo (the payload build only runs whenever I merge to its dedicated branch).



    Recently I've made changes to the project (switch to bun as package manager and script runner, migrate to ESM) which I'd had to rollback.



    Currently the build succeeds locally, plus stale cache in Payload Cloud seems to have been an issue in the past when I've made changes to the project setup itself.



    @1103357985847267442

    Can you do me a solid and clear the cache on my project? Pretty sure that's why my build is failing: ProjectId 65ab7dfd9cd1b4cda482f61c

  • discord user avatar
    denolfe
    last year

    This doesn't appear to have anything to do with the cache



    Cleared the cache and re-attempted deploy, still same error on build



    [2024-09-22T15:20:57]
    │ Running custom build command: yarn payload:build
    [2024-09-22T15:21:04]
    │ src/payload-cms/fields/_sidebar/tenant/index.ts(1,30): error TS2307: Cannot find module 'core/utilities/isSuperadmin' or its corresponding type declarations.
    [2024-09-22T15:21:04]
    │ src/payload-cms/collections/Availabilities/index.ts(1,35): error TS2307: Cannot find module 'core/access/tenantSuperadmins' or its corresponding type declarations.
  • default discord avatar
    ingrid741last year
    @967118574445547650

    The build fails because three modules were renamed. No amount of reinstalling, changing settings and redeploying makes Cloud discover that these files were renamed. Thx for the cache clear, do you think there could be other caches at play?

  • discord user avatar
    denolfe
    last year

    I don't see how caching would have anything to do with this. Do you have a tsconfig path alias for

    core

    that needs to be adjusted? What rename did you do in your codebase?

  • default discord avatar
    ingrid741last year

    I thought it was a hangup with the aliases at first, but the same aliases work for all other files than the three that were renamed, pretty sure the renames is the hangup



    Locally builds fine

  • discord user avatar
    denolfe
    last year

    Is this a monorepo or something? Can you show your tsconfig.json that has

    core

    in it?



    We've done all we can do on our end as far as cache clearing goes. It likely resides in your code.

  • default discord avatar
    ingrid741last year

    Yes it's a monorepo



    {
      "compilerOptions": {
        "target": "ESNext",
        "module": "NodeNext",
        "moduleResolution": "NodeNext",
        "declaration": true,
        "declarationMap": true,
        "composite": true,
        "downlevelIteration": true,
        "lib": [
          "dom",
          "dom.iterable",
          "esnext"
        ],
        "allowJs": true,
        "strict": true,
        "esModuleInterop": true,
        "skipLibCheck": true,
        "rootDir": ".",
        "outDir": "dist",
        "jsx": "react-jsx",
        "sourceMap": true,
        "resolveJsonModule": true,
        "baseUrl": ".",
        "paths": {
          "internal/*": ["./src/interface/*"],
          "core/*": ["./src/payload-cms/*"],
          "vipps/*": ["src/plugins/vipps/*"],
          "@vippsmobilepay/sdk/script/types": ["../../node_modules/@vippsmobilepay/sdk/script/types.d.ts"] // https://github.com/vippsas/deno-sdk/issues/61
        }
      },
      "references": [
        { "path": "../interface" }
      ],
      "include": [
        "src/**/*",
        "babel.config.js",
        ".eslintrc.js"
      ],
      "exclude": [
        "dist", 
        "build", 
        "node_modules"
      ],
      "ts-node": {
        "transpileOnly": true
      }
    }


    Never had an issue with these aliases



    As mentioned they work, just not for those three renamed files



    @967118574445547650

    @1103357985847267442

    Turns out if you don't set


    git config core.ignorecase false

    git doesn't notice case changes in filenames.


    TYSM for your help and sorry for my lack of faith!!

  • discord user avatar
    denolfe
    last year

    Awesome!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.