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

0.4.2 bad release? #20

Open
ghost opened this issue Feb 11, 2020 · 6 comments
Open

0.4.2 bad release? #20

ghost opened this issue Feb 11, 2020 · 6 comments

Comments

@ghost
Copy link

ghost commented Feb 11, 2020

I'm getting now the following js error in our app:

Uncaught Error: Could not find module `date-fns` imported from...

Not sure why, as I didn't change anything but updating ember-power-calendar-date-fns from 0.4.1 to 0.4.2.

When I force the version to 0.4.1 it works normally.
Could also be a Issue with the implementation inside our app, but we are not doing anything special.

Do you have a clue why this happens?

@makepanic
Copy link
Owner

makepanic commented Feb 11, 2020

Hi,
which date-fns version is your app using?

The only change is 22257e5 which changes it to use module imports directly.

See https://date-fns.org/docs/Getting-Started#submodules

I guess that means date-fns@1 has no submodule method exports 🤔
Can you bump date-fns to version 2?

I made this change because it allows ember-auto-import to minify the package better.

@ghost
Copy link
Author

ghost commented Feb 11, 2020

My app is using date-fns@2.9.0.
Are you using 0.4.2 in an app?

I'm using ember-power-calendar@0.13.3, ember@3.13.1 and ember-auto-import@1.5.3.

I will test a bit and let you know, sounds like a issue with our app.

@makepanic
Copy link
Owner

makepanic commented Feb 11, 2020

Is the error thrown from within your app code or from the ember-power-calendar package?

Is date-fns part of your dev/dependencies list? I can reproduce a similar error if I remove date-fns from my devDependencies.

This makes sense though, as we're importing from date-fns in our app too.

@ghost
Copy link
Author

ghost commented Feb 11, 2020

it is thrown within my app code.
🤔 date-fns is part of my dependencies list inside an other addon (addon A) which my app is using, not the addon (addon B) which requires ember-power-calendar.
Yea, by adding date-fns as dependency to the addon B is working

@ghost
Copy link
Author

ghost commented Feb 11, 2020

so i guess this is intended and i should include date-fns as dependency?

@makepanic
Copy link
Owner

I think so.

If i create a vanilla project that uses power calendar + power calendar date-fns it works fine.

I think it's ok to let consumers explicitly depend on date-fns if they want to use it.

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

1 participant