Hi there i am trying to play around with packages and installed the date-fns package but cant seem to use it, i have a feeling its because of how my folders are set up but dont know the right way
im not sure what i have done is correctt so i ran npm init -y on mmy mac terminal then npm install date-fns
This is not to do with date-fns, rather with how Node handles ES Modules.
If you follow the instructions you see in the error message, you can resolve the problem. Add the following to package.json:
With Vite running (npm run dev) and the code main.js as per your screenshot, visit http://localhost:5173 in your browser and open the console. You will see the output.
so i was just opening using vs code open with live server before and that was showing an error but your link worked, what is the difference here and how would i have known this ?