NJadav
NJadav8mo ago

React (CRA) deploy via deno

Getting an error while building react CRA via deno deploy. Error: ENOENT: no such file or directory, opendir '/home/runner/work/mrdcare-frontend/build I am also attaching a screenshot workflow file.
2 Replies
Deno AI Helper
Deno AI Helper8mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the error message you've provided, it seems like there might be an issue with the file path or directory structure in your project. The ENOENT error typically indicates that a specified file or directory cannot be found. This could mean that the /home/runner/work/mrdcare-frontend/build directory does not exist or is not correctly referenced in your workflow. Without seeing the actual workflow file or the context in which this error occurs, I can only suggest that you verify the following: 1. Ensure that the build directory exists at the specified path before the Deno deploy process tries to access it. 2. Check if the path to the build directory is correctly specified in your workflow file. 3. Make sure that any steps that should create the build directory (like a build script) are successfully completing before the deploy step is initiated. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. If the issue persists, you may want to look into more detailed logs or error messages to pinpoint the exact cause of the problem.
NJadav
NJadav8mo ago
name: Deploy on: push: branches: main pull_request: branches: main jobs: deploy: name: Deploy runs-on: ubuntu-latest permissions: id-token: write # Needed for auth with Deno Deploy contents: read # Needed to clone the repository steps: - name: Clone repository uses: actions/checkout@v3 - name: Install Deno uses: denoland/setup-deno@v1 with: deno-version: v1.x - name: Install Node.js uses: actions/setup-node@v3 with: node-version: lts/* - name: Build step run: "yarn install && yarn run" # 📝 Update the build command(s) if necessary - name: Upload to Deno Deploy uses: denoland/deployctl@v1 with: project: "mrdcare-frontend" entrypoint: "https://deno.land/std@0.188.0/http/file_server.ts" root: "path to build directory" Here is the workflow file, but I didn't know about how to set root path. This was fixed by adding CI: '' in workflow file.