[solved] Running into build error with import even when it works locally.

Have a file Layout.tsx importing Header.tsx both in same directory, but still runs into build error.
37 Replies
Mehul Sharma
Mehul SharmaOP3y ago
Samathingamajig
do you have a default export in Header.tsx?
Mehul Sharma
Mehul SharmaOP3y ago
yep
Mehul Sharma
Mehul SharmaOP3y ago
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Mehul Sharma
Mehul SharmaOP3y ago
im a bit new to Ts not sure what that is
Samathingamajig
did you create this app with create-t3-app?
Mehul Sharma
Mehul SharmaOP3y ago
unfortunately the time i created this was using create-next-app (also new to t3)
Samathingamajig
Running into build error with import even when it works locally.
is this a build error when deploying ?
Mehul Sharma
Mehul SharmaOP3y ago
have this:
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
in tsconfig
Samathingamajig
thats what your question implies
Mehul Sharma
Mehul SharmaOP3y ago
yep
Samathingamajig
do you have a github repo for this?
Mehul Sharma
Mehul SharmaOP3y ago
yep but it's private atm not sure if i have the rights to show
Samathingamajig
on vercel or something else?
Mehul Sharma
Mehul SharmaOP3y ago
yep vercel could the error be because of filenames starting with a capital letter?
Samathingamajig
make sure that Header.tsx is tracked by git shouldnt be
Mehul Sharma
Mehul SharmaOP3y ago
exactly
Mehul Sharma
Mehul SharmaOP3y ago
aha!
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Mehul Sharma
Mehul SharmaOP3y ago
i guess when i changed the name it didn't track it
Samathingamajig
that's the issue
Samathingamajig
Stack Overflow
Changing capitalization of filenames in Git
I am trying to rename a file to have different capitalization from what it had before: git mv src/collision/b2AABB.js src/collision/B2AABB.js fatal: destination exists, source=src/collision/b2AABB...
Samathingamajig
follow the instructions here
Mehul Sharma
Mehul SharmaOP3y ago
thanks a lot! how do i mark the question solved?
Samathingamajig
¯\_(ツ)_/¯ is there an "archive" in the options?
Samathingamajig
the 3 dots menu
Samathingamajig
i only see that because i'm not admin/OP
Mehul Sharma
Mehul SharmaOP3y ago
there's a close post
Samathingamajig
does the deployment work tho
Mehul Sharma
Mehul SharmaOP3y ago
fixing the casing now and redeploying but i think it will @Samathingamajig it worked! other errors happening gonna fix that, thanks!
shaaah
shaaah3y ago
What approach did you follow from the stackover flow? In cases like this I usually delete the file and create it again so git can start tracking
Mehul Sharma
Mehul SharmaOP3y ago
used git mv myFile MyFile and it worked, even without the --force flag
Samathingamajig
btw you should use git mv oldname newname whenever renaming/moving a file, because otherwise git will be dumb and think you deleted a file and added a file and the history of the file will be "lost" (though you can go back in commits and view the history of the old file name)
shaaah
shaaah3y ago
ah right , I usually renamed images so far, good info, I dint think about that.
Mehul Sharma
Mehul SharmaOP3y ago
yep, learned a completely new thing today haha thanks.
Want results from more Discord servers?
Add your server