I installed date-fns via npm and got the folder in the project under ./node_modules/date-fns
Importing with ‘import { format } from “date-fns” results in error ‘Relative references must start with either “/”…’
Changing to ”import { format } from “./node_modules/date-fns/”‘ results in error ‘Expected a JavaScript Module but the server responded with MIM type of “text/html”.
Anyone can help on this kind of issue?
I also checked the package.json, which looks as follows:
{
“dependencies”: {
“date-fns”: “^3.6.0”
}
}
Ramon Serrano is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.