Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module not found: Can't resolve '*.module.css'

Tags:

reactjs

I'm new to React. How can I fix this.? when className added the error shown. My Employees.js file is,

import classes from '*.module.css';
import { Paper, makeStyles } from '@material-ui/core';
import React from 'react';
import EmployeeForm from './EmployeeForm';

const useStyles = makeStyles(theme =>({
    pageContent:{
        margin:theme.spacing(5),
        padding:theme.spacing(3)
    }    
}))

export default function Employees(){
    return(
        <>
            <Paper className={classes.pageContent}>
            <EmployeeForm /> 
            </Paper>
               
        </>    
    )
}

The error is,

Module not found: Can't resolve '*.module.css' in 'C:\Users\react_ui\src\Pages\Employees'
like image 895
Tharindu Marapana Avatar asked Sep 01 '25 17:09

Tharindu Marapana


1 Answers

The error is because you are importing module.css incorrectly replace your line no.1 with this import "./module.css" and make sure your module.css is in the same directory.

like image 94
Chitrang Sharma Avatar answered Sep 04 '25 07:09

Chitrang Sharma