React: “Module not found: Can't resolve” Path error

So, I have this code in my src/components

import PropTypes from 'prop-types';
import React from 'react';
import Typography from 'Typography'; 
I got the error on like 3
Module not found: Can't resolve 'Typography'

I have one file named Typography.js in same directory

PS: I have two ununtu system

In one system this code is working fine and in another system it'll gives error.

If I use import Typography from './Typography'; then it won't give me error but why in one system same code is working fine and In another system it gives error?

Should I have use import Typography from './Typography'; everywhere?

#javascript #reactjs

1 Likes21.75 GEEK