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

Deprecation warning still present in 4.0 #271

Closed
gzurbach opened this issue Jan 6, 2021 · 5 comments
Closed

Deprecation warning still present in 4.0 #271

gzurbach opened this issue Jan 6, 2021 · 5 comments

Comments

@gzurbach
Copy link

gzurbach commented Jan 6, 2021

Hi there!

I just updated ember-router-scroll to ^4.0.0 in my app (Ember 3.16) and I am seeing the following warning in the console:

DEPRECATION: The use of Ember.Router in setupRouter is deprecated. Please use the router service.

I thought that v4.0 was supposed to address this? Am I missing something?

Thanks a lot for all the good work! 👍

@snewcomer
Copy link
Collaborator

Huh interesting! Do you call setupRouter in your app code. I believe we are doing the right thing on our side.

setupRouter(this.router);

@gzurbach
Copy link
Author

gzurbach commented Jan 6, 2021

There is no trace of setupRouter in my app code. Also, uninstalling ember-router-scroll does fix the warning. But then I don't get that sweet sweet scroll to top behavior 😅

It does appear that this plugin is doing the right thing, which is why I am confused as well. It would be interesting to see if others experience the same issue.

@gzurbach
Copy link
Author

gzurbach commented Jan 7, 2021

I think I figured it out. The deprecation warning seems to be erroneous in ember-app-scheduler:

https://github.com/ember-app-scheduler/ember-app-scheduler/blob/master/addon/scheduler.ts#L84

The second parameter of deprecate() is documented as follow:

If falsy, the deprecation will be displayed.

Therefore, router instanceof Router should be !(router instanceof Router) or router instanceof RouterService.

@RobbieTheWagner
Copy link
Contributor

Seeing this issue as well.

@gzurbach
Copy link
Author

This issue was fixed in [email protected] released a few hours ago. Uninstalling and reinstalling ember-router-scroll allowed npm to pickup the new version. Problem solved!

See ember-app-scheduler/ember-app-scheduler#962

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

3 participants