Replies: 5 comments 1 reply
-
Had the same problem, this was 100% the issue. If anyone else has this problem, check the casing of the files in your git repo online matches what you're seeing locally |
Beta Was this translation helpful? Give feedback.
-
I have a next.js app and followed this quick tutorial to install amplify, for some reason when deploying to heroku it fails and it says a file cannot be found. It's there, in the place specified, I've checked casing and paths, and it works perfect locally. But when deploying to heroku it says the module is not found. remote: ./src/pages/app.js
remote: Module not found: Can't resolve '../aws-exports' in '/tmp/build_c9a09900/src/pages' my folder structure is as follows: src
L pages
L index.js
L app.js
L aws-exports.js app.js import Head from 'next/head'
import Image from 'next/image'
import styles from '../../styles/Home.module.css'
import { Amplify } from 'aws-amplify'
import awsExports from '../aws-exports'
import { withAuthenticator, Button, Heading } from '@aws-amplify/ui-react'
import '@aws-amplify/ui-react/styles.css'
Amplify.configure(awsExports)
function App({ signOut, user }) {
return (
<>
<div className={styles.container}>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>
<Heading level={1}>Hello {user.username}</Heading>
<Button onClick={signOut}>Sign out</Button>
</div>
</>
)
}
export default withAuthenticator(App) |
Beta Was this translation helpful? Give feedback.
-
I got the same issue when I deploy next.js app on heroku. Any solution to solve it? |
Beta Was this translation helpful? Give feedback.
-
Same issue |
Beta Was this translation helpful? Give feedback.
-
As suggested earlier it turns out it was casing for me too. I had to check this twice as I was convinced the casing was the same the first time, but turned out I was trying to import an icon named "FileCsv.svg" when it was actually called "FileCSV.svg". |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have implemented absolute import as per documentation here: https://nextjs.org/docs/advanced-features/module-path-aliases
environment setup
when npm run build locally, it run successfully without an issue but failed to deploy in heroku.
Heroku build Log
Anyone facing this issue or know the solution? Thanks you.
Solved:
Case sensitivity issue. It is regarding using import path with uppercase
Layout
instead of lowercase in directory.Somehow it still works in my Windows development environment and not throwing any warning or error.
Beta Was this translation helpful? Give feedback.
All reactions