0

I'm trying to deploy a NextJS app using AWS Amplify. When I use 'npm run dev' locally, everything works as expected. When I use 'npm run build', everything also compiles fine locally. When I push changes to the branch that AWS Amplify is monitoring, it fails to build, stating:

[WARNING]: Failed to compile.
./src/app/page.tsx
Module not found: Can't resolve '@/styles/Home.css'

Here's my tsconfig.json:

tsconfig

Here's the file the error is occurring:

src/app/page.tsx

Here's my file tree:

files

And here's the AWS build logs:

AWS logs

Any help is greatly appreciated!

1 Answer 1

1

SOLVED: By changing file: "Home.css" -> "home.css". No idea why making it lower-case magically worked. Many of my other *.css files use Pascal Casing, and they are imported just fine. Hope this helps somebody else!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.