Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error TS1383: Only named exports may use 'export type'

Could someone please help me with this error?

Error: node_modules/date-fns/index.d.ts:246:1 - error TS1383: Only named exports may use 'export type'.

246 export type * from "./types.js";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
typescript version
"typescript": "^4.9.3"
npm version
10.5.0
angular 16
"@angular/material": "^15.2.9",

I use the latest version of typescript but it causes other problems.

like image 403
Chaymae LOUKILI Avatar asked Oct 19 '25 02:10

Chaymae LOUKILI


1 Answers

This is a known issue of date-fns. There are two options to fix the error:

  1. Downgrade date-fns to v3.1.0
  2. Update TypeScript to v5. For this you will need to update Angular to v16, see the version compatibility table
like image 198
JSON Derulo Avatar answered Oct 21 '25 15:10

JSON Derulo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!