Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only named exports may use 'export type' #261

Open
kosaa opened this issue Dec 21, 2023 · 4 comments
Open

Only named exports may use 'export type' #261

kosaa opened this issue Dec 21, 2023 · 4 comments

Comments

@kosaa
Copy link

kosaa commented Dec 21, 2023

few days ago it was working fine, for now after npm install its not working and i have error like below

tested on date-fns-tz versions

  • 1.3.8
  • 2.0.0

sample import

import { utcToZonedTime, zonedTimeToUtc } from 'date-fns-tz';

stacktrace

./node_modules/date-fns-tz/format/index.js:8:36-71 - Error: Module not found: Error: Package path ./format/index.js is not exported from package node_modules/date-fns (see exports field in node_modules/date-fns/package.json)

./node_modules/date-fns-tz/formatInTimeZone/index.js:8:36-81 - Error: Module not found: Error: Package path ./_lib/cloneObject/index.js is not exported from package node_modules/date-fns (see exports field in node_modules/date-fns/package.json)

./node_modules/date-fns-tz/toDate/index.js:8:36-79 - Error: Module not found: Error: Package path ./_lib/toInteger/index.js is not exported from package node_modules/date-fns (see exports field in node_modules/date-fns/package.json)

./node_modules/date-fns-tz/toDate/index.js:10:37-102 - Error: Module not found: Error: Package path ./_lib/getTimezoneOffsetInMilliseconds/index.js is not exported from package node_modules/date-fns (see exports field in node_modules/date-fns/package.json)

./node_modules/date-fns-tz/zonedTimeToUtc/index.js:8:36-81 - Error: Module not found: Error: Package path ./_lib/cloneObject/index.js is not exported from package node_modules/date-fns (see exports field in node_modules/date-fns/package.json)

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

243 export type * from "./types.js";
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/date-fns/intlFormatDistance.d.ts:9:12 - error TS2694: Namespace 'Intl' has no exported member 'UnicodeBCP47LocaleIdentifier'.

9     | Intl.UnicodeBCP47LocaleIdentifier
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/date-fns/intlFormatDistance.d.ts:10:12 - error TS2694: Namespace 'Intl' has no exported member 'UnicodeBCP47LocaleIdentifier'.

10     | Intl.UnicodeBCP47LocaleIdentifier[];
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/date-fns/intlFormatDistance.d.ts:12:24 - error TS2694: Namespace 'Intl' has no exported member 'RelativeTimeFormatLocaleMatcher'.

12   localeMatcher?: Intl.RelativeTimeFormatLocaleMatcher;
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/date-fns/intlFormatDistance.d.ts:14:18 - error TS2694: Namespace 'Intl' has no exported member 'RelativeTimeFormatNumeric'.

14   numeric?: Intl.RelativeTimeFormatNumeric;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~


Error: node_modules/date-fns/intlFormatDistance.d.ts:16:16 - error TS2694: Namespace 'Intl' has no exported member 'RelativeTimeFormatStyle'.

16   style?: Intl.RelativeTimeFormatStyle;
                  ~~~~~~~~~~~~~~~~~~~~~~~


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

2 export type * from "./locale/types.js";
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

3 export type * from "./fp/types.js";
@EmilioHerreraSoukup
Copy link

Im having the same issue, related to #260

@marnusw
Copy link
Owner

marnusw commented Apr 6, 2024

@kosaa Please check whether this is resolved in v3.0.0.

@JBralish
Copy link

I am currently getting this same issue when building with version 3.6.0.

@rafakwolf
Copy link

same issue here, version 3, typescript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants