Git Product home page Git Product logo

Comments (7)

joanllenas avatar joanllenas commented on May 25, 2024 1

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.

hwebb avatar hwebb commented on May 25, 2024 1

I just updated date-fns to 2.21.1 and it worked indeed! I should have started with that.

from ngx-date-fns.

joanllenas avatar joanllenas commented on May 25, 2024

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.

jpduckwo avatar jpduckwo commented on May 25, 2024

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.

joanllenas avatar joanllenas commented on May 25, 2024

Feel free to reopen if you still need help.

from ngx-date-fns.

MickL avatar MickL commented on May 25, 2024

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.

hwebb avatar hwebb commented on May 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.