Open neeppy opened 2 years ago
Take a look at #587 and #821
Thank you for your reply, @styfle! Unfortunately, I already stumbled upon those issues before posting my own and they couldn't help me find a resolution.
To be more clear about my issue, I'm trying to create a CLI module alongside my NextJS app that would allow me to perform certain actions manually from a terminal. However, as of now, I'm stuck with using plain node myscript.js
to run anything, meaning I can't really make use of code previously written. ncc
is the closest thing I could find, but because I have path aliases defined for the Next app, it still makes it unusable in my usecase.
I am also facing the same issue, in SignInForm.jsx I imported import signIn from '@myFirebase/auth/SignIn'; and it seems vercel doesn't understand custom paths
./app/sign-in/SignInForm.jsx
--
14:12:28.702 | Module not found: Can't resolve '@myFirebase/auth/SignIn
This is my jsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@myFirebase/*": ["components/firebase/*"],
"@components/*": ["components/*"],
"@styles/*": ["styles/*"]
}
}
}
Two year later, but in case it happens for anyone else, in my case it was Git which lowercased one of my file paths. I found this: https://vercel.com/support/articles/how-do-i-resolve-a-module-not-found-error which suggested to set it not to ignore casings with git config core.ignorecase false.
this is still not working in my case. { "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./*"] } } }
causes import issues if I use @/something
Context I have a NextJS application (running JS, not TS) with a
jsconfig.json
file used to map some module aliases (@utils
for example). Everything works fine there! However, we need to manually run some NodeJS scripts to alter the database. I decided to go withncc
because I thought it would allow me to reuse the NextJS code (I'm talking about server-side code, obviously). However, here comes the issue: whenever we attempt to import a module from our NextJS app, we get aModule not found
error if the import tree includes an alias (seems likencc
ignoresjsconfig.json
).Expected Result Take
compilerOptions.paths
fromjsconfig.json
into account when building the app.The docs haven't been too useful about this issue.