alexnguyennz / astro-aws-amplify

Astro adapter for Astro SSR deployments on AWS Amplify
https://www.astroawsamplify.com
MIT License
16 stars 2 forks source link

Getting a 404 on every url after following instructions 100% #24

Closed OriGummy closed 3 weeks ago

OriGummy commented 3 weeks ago

Hello and thanks a bunch for making this adapter.

I am having trouble making it work. I follwed all instructions as per the wiki. But I am only getting 404s on every url.

Tech stack:

astro.config.mjs

import { defineConfig } from 'astro/config'; import tailwind from "@astrojs/tailwind";

import svelte from "@astrojs/svelte"; import awsAmplify from 'astro-aws-amplify';

// https://astro.build/config export default defineConfig({ integrations: [tailwind(), svelte()], output: "server", adapter: awsAmplify(), });

amplify.yml (in amplify website ui, not in my git)

version: 1 frontend: phases: preBuild: commands:

  • npm ci build: commands:
  • npm run build
  • mv node_modules ./.amplify-hosting/compute/default artifacts: baseDirectory: .amplify-hosting files:
    • '*/' cache: paths:
    • node_modules/*/

Downloading the deployment artifacts gives the expected result:

zip file |-compute |-static |-deplot_manifest.json

Builds are going on just fine, no problem I see in the logs. Can locally run npm run dev just fine, can run with a nodejs adapter on my self hosted server.

What could be the cause of this?

Appendix - build logs:

`0

2024-06-20T21:03:49.451Z [INFO]: # Cloning repository: git@github.com:OriGummy/Academease.git

1

2024-06-20T21:03:50.968Z [INFO]:

2

2024-06-20T21:03:50.969Z [INFO]: Cloning into 'Academease'...

3

2024-06-20T21:03:50.969Z [INFO]: # Switching to commit: 1683d091c757e7408e1f17fc274dd8e31f1e6064

4

2024-06-20T21:03:51.017Z [INFO]: Note: switching to '1683d091c757e7408e1f17fc274dd8e31f1e6064'.

5

You are in 'detached HEAD' state. You can look around, make experimental

6

changes and commit them, and you can discard any commits you make in this

7

state without impacting any branches by switching back to a branch.

8

If you want to create a new branch to retain commits you create, you may

9

do so (now or later) by using -c with the switch command. Example:

10

git switch -c

11

Or undo this operation with:

12

git switch -

13

Turn off this advice by setting config variable advice.detachedHead to false

14

HEAD is now at 1683d09 fix

15

2024-06-20T21:03:51.116Z [INFO]: Successfully cleaned up Git credentials

16

2024-06-20T21:03:51.117Z [INFO]: # Checking for Git submodules at: /codebuild/output/src2988892587/src/Academease/.gitmodules

17

2024-06-20T21:03:51.123Z [INFO]: # Retrieving environment cache...

18

2024-06-20T21:03:51.219Z [INFO]: # Retrieved environment cache

19

2024-06-20T21:03:51.219Z [INFO]: ---- Setting Up SSM Secrets ----

20

2024-06-20T21:03:51.219Z [INFO]: SSM params {"Path":"/amplify/d3f2zbboiiam9y/master/","WithDecryption":true}

21

2024-06-20T21:03:52.235Z [INFO]: No live updates for this build run

22

2024-06-20T21:03:52.239Z [INFO]: # Retrieving cache...

23

2024-06-20T21:03:52.306Z [INFO]: # Extracting cache...

24

2024-06-20T21:03:52.308Z [INFO]: # Extraction completed

25

2024-06-20T21:03:52.308Z [INFO]: # Retrieved cache

26

2024-06-20T21:03:57.901Z [INFO]: ## Starting Backend Build

27

Checking for associated backend environment...

28

No backend environment association found, continuing...

29

Completed Backend Build

30

2024-06-20T21:03:57.907Z [INFO]: {"backendDuration": 0}

31

Starting Frontend Build

32

Starting phase: preBuild

33 Tech stack:

Executing command: npm ci

34

2024-06-20T21:04:24.992Z [WARNING]: npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.

35

2024-06-20T21:04:25.427Z [WARNING]: npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

36

2024-06-20T21:04:25.430Z [WARNING]: npm WARN

37

2024-06-20T21:04:25.430Z [WARNING]: deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

38

2024-06-20T21:04:25.440Z [WARNING]: npm WARN

39

2024-06-20T21:04:25.440Z [WARNING]: deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

40

2024-06-20T21:04:29.604Z [INFO]: added 707 packages, and audited 708 packages in 17s

41

2024-06-20T21:04:29.610Z [INFO]: 219 packages are looking for funding

42

run npm fund for details

43

2 high severity vulnerabilities

44

To address all issues, run:

45

npm audit fix

46

Run npm audit for details.

47

2024-06-20T21:04:29.625Z [INFO]: # Completed phase: preBuild

48

Starting phase: build

49

Executing command: npm run build

50

2024-06-20T21:04:29.963Z [INFO]: > academease@0.0.1 build

51

astro check && astro build

52

2024-06-20T21:04:33.354Z [INFO]: 21:04:33 [vite] Forced re-optimization of dependencies

53

2024-06-20T21:04:33.377Z [INFO]: 21:04:33 Types generated 50ms

54

2024-06-20T21:04:33.383Z [INFO]: 21:04:33 [check] Getting diagnostics for Astro files in /codebuild/output/src2988892587/src/Academease...

55

2024-06-20T21:04:36.475Z [INFO]: astro.config.mjs:3:1 - warning ts(6133): 'node' is declared but its value is never read.

56

3 import node from "@astrojs/node";

57

  ~~~~~~~~~

58

2024-06-20T21:04:36.761Z [INFO]: src/components/Nav.astro:44:9 - warning astro(4000): This script will be treated as if it has the is:inline directive because it contains an attribute. Therefore, features that require processing (e.g. using TypeScript or npm packages in the script) are unavailable.

59

See docs for more details: https://docs.astro.build/en/guides/client-side-scripts/#script-processing.

60

Add the is:inline directive explicitly to silence this hint.

61

44 Githubissues.

  • Githubissues is a development platform for aggregating issues.