Comments (7)
Hi @hwebb you need to install date-fns v2.16.1
or >= v2.21.1
I updated the installation instructions here: https://github.com/joanllenas/ngx-date-fns#installation
It's very confusing, I hope this helps.
from ngx-date-fns.
I just updated date-fns to 2.21.1 and it worked indeed! I should have started with that.
from ngx-date-fns.
Hi @hwebb ,
your package doesn't work anymore.
You mean that you had an application where the lib was working, then you upgraded to a newer version and it stopped working? if that is the case, can you tell me which versions?
I get nearly 100 errors like "node_modules\ngx-date-fns\fesm2015\ngx-date-fns.js depends on 'date-fns/parseISO'. CommonJS or AMD dependencies can cause optimization bailouts.".
Ok, those 100 errors you mention are actually warnings. Each warning comes with a link, If you click on it you'll find instructions about how to avoid them.
I'm wondering what is ngx-date-fns doing?
What do you mean?
from ngx-date-fns.
I believe there is something wrong with the format of the date-fns package version 2.17.0. Try to install 2.16.1 and test again
npm install [email protected]
This fixed all my issues...
from ngx-date-fns.
Feel free to reopen if you still need help.
from ngx-date-fns.
I guess the warnings @hwebb described are not related to his problem. ngx-date-fns working fine for me, I am on date-fns 2.16.1.
from ngx-date-fns.
I tried installing it again with the version 2.19.0, and still have all those errors.
The errors are removed as soon as I comment out DateFnsModule.forRoot()
from the app module.
I import the it with import { DateFnsModule } from 'ngx-date-fns';
so I'm doing exactly as in your docs.
Other info is I'm on Windows.
The error is always like node_modules\ngx-date-fns\__ivy_ngcc__\fesm2015\ngx-date-fns.js depends on 'date-fns/formatDuration'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
The link is always pointing to the same website which just asks me to add all those dependencies to angular.json "allowedCommonJsDependencies", which is a couple of hundreds so I prefer avoiding it.
I would like using pure ES6 and not commun.js, this answer on stackoverflow says that some libraries have a special ES6 version that can be used instead https://stackoverflow.com/a/62589268/1063653
But I see that I'm the only one having this specific issue and I'm wondering if it's not an issue deeper into the code that is messing up with common.js.
Thanks
from ngx-date-fns.
Related Issues (20)
- Pipes isToday, isWeekend, isSameMonth HOT 4
- IsSameYear pipe HOT 3
- Support date-fns-tz HOT 8
- Add dfnsParseIso pipe HOT 2
- Allow empty value (Prevent throwing "Invalid time value") HOT 4
- Documentation for lazy loaded modules HOT 1
- Support `strictTemplates` / All pipes should accept null and undefined HOT 4
- FR: Add *Duration pipes HOT 2
- IsEqual Pipe HOT 2
- "CommonJS or AMD" warnings HOT 9
- Documentation about tree shaking is not correct HOT 2
- FR: dfnsFormatRelativeToNow HOT 4
- is*() functions are missing HOT 5
- What is the amLocal equivalent of ngx-moment? HOT 2
- Angular 13 : "Encourage the library authors to publish an Ivy distribution" HOT 8
- Angular 14 support HOT 7
- Angular 16 support HOT 4
- date-fns 3.x support HOT 5
- Auto-detect language HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-date-fns.