#github deploy failing

4 messages · Page 1 of 1 (latest)

viral wolf
#

Following the tutorial https://docs.astro.build/en/guides/deploy/github/

I am trying to deploy my site to my github pages, and have been following the above tutorial. Currently the github action is failing in the build step with the error:
src/layouts/BaseLayout.astro:7:17 - error ts(2307): Cannot find module '../components/Nav.astro' or its corresponding type declarations.

7 import Nav from '../components/Nav.astro';

even thought that module does exist.

when in my local dev enviroment, running astro check && astro build complete successfully but that step fails in github

thin pineBOT
#

Hi @viral wolf. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

I'm sorry to hear that you're having trouble deploying your Astro site to GitHub Pages. The error message you're seeing suggests that the GitHub Action is unable to find the Nav.astro module. This could be due to a few reasons:

  1. File Path: Ensure that the file path in your import statement is correct. Even a small typo could cause this issue. The path should be relative to the file where you're trying to import the Nav.astro module.

  2. Case Sensitivity: GitHub Actions run on Linux servers, which have case-sensitive file systems. This means Nav.astro is different from nav.astro. Make sure the case in your import statement matches the actual file name.

  3. Node Version: The GitHub action yaml that is created for you assumes the use of node 14. This could cause the Astro build to fail. To resolve this, update your project's package.json file with this snippet to specify a node version of 18 or higher:

"engines": {
  "node": ">=18.0.0"
}

Source (https://docs.astro.build/en/guides/deploy/microsoft-azure/#known-issues)

If none of these solutions work, you might want to consider creating a GitHub issue to alert the Astro team of your problem. Here's the link to create a new issue: Create GitHub Issue (https://github.com/withastro/docs/issues/new).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@viral wolf kapa.ai is still learning and improving, please let us know how it did by reacting below