[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# Neither relative nor aliased imports working

169 views · 2 likes · 4 posts


Just For Fun (@zeantsoi-gmailcom) · 2024-07-31

I've been developing a NextJS app locally without issue but have hit issues when deploying to Vercel. Specifically, in the Vercel build, I'm hitting this error:

> ./src/app/dashboard/page.tsx
> Module not found: Can't resolve '../../components/Chart'

The relative path is valid and has no issue routing in development. I had previously been using the `@` alias, again without issue locally, but decided to use a relative import to see if it'd resolve – clearly it has not.

FWIW, this is my directory structure:

```
/project-root
  /src
    /app
      /dashboard
        page.tsx
    /components
      Chart.tsx
  next.config.mjs
  package.json
```

Anyone else run into similar issues with imports working locally, but breaking on Vercel?


Pauline P. Narvas (@pawlean) · 2024-07-31

Hi, @zeantsoi-gmailcom!

Welcome to the Vercel Community :smiley: 

I'll share this internally and ask for some pointers, but it would also be helpful if you could create a **[minimal reproducible example](https://vercel.com/guides/creating-a-minimal-reproducible-example)** for us to dig deeper.


Pauline P. Narvas (@pawlean) · 2024-07-31

Hi, @zeantsoi-gmailcom!

This guide might be helpful. :smile: 

https://vercel.com/guides/how-do-i-resolve-a-module-not-found-error


Just For Fun (@zeantsoi-gmailcom) · 2024-07-31 · ♥ 2

Thank you, @pawlean! This bit resolved my issue:

> make sure `git config core.ignorecase false` is set in your environment.

To be clear, the issue appears to be that Vercel's filesystem is case-sensitive, but the files I checked into version control were not. Here is my file structure:

```
/project-root
  /src
    /app
      /dashboard
        page.tsx
    /components
      Chart.tsx
```

In `dashboard/page.tsx`, the following import was working locally, but not on Vercel:

```
import Chart from '@/components/Chart';
```

By setting my git config per the instructions above, then deleting and readding the `Chart.tsx` file (and committing the change at each step), I was able to resolve the issue on Vercel.