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

node_modules\date-fns-tz\esm\formatInTimeZone\index.js depends on 'date-fns/_lib/cloneObject/index.js'. CommonJS or AMD dependencies can cause optimization bailouts in angular project #193

Open
vamshi-rafcos opened this issue Jul 16, 2022 · 3 comments

Comments

@vamshi-rafcos
Copy link

vamshi-rafcos commented Jul 16, 2022

i am using date-fns and also for time zones date-fns-tz.
But when using formatInTimeZone method , angular giving CommonJS or AMD dependencies can cause optimization bailouts warning as depends on date-fns/cloneObject.

i am importing like using suggestion given by date-fn-tz
import formatInTimeZone from 'date-fns-tz/esm/formatInTimeZone';
but other methods in date-fns-tz working fine like utcToZonedTime,toDate,it doesn't giving any warnings

angular@14
node@16.15

@phcent
Copy link

phcent commented Jul 28, 2022

The date-fns package referenced under date-fns-tz/esm is not a bug caused by esm

@urielzen
Copy link

Same issue for me when using import format from 'date-fns-tz/esm/format'

Looks like some date-fns-tz esmodules are importing non-esmodules in some instances.

image

@tomstolarczuk
Copy link

Importing as import { zonedTimeToUtc } from 'date-fns-tz'; gives the same error about CJS modules.

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

4 participants