An instance of PageScrollService already exists, usually inc


Topic: An instance of PageScrollService already exists, usually including one provider should be enough, so double check.

Aroquiassamy LA ROZE pro premium asked 2 months ago

Expected behavior

When I click the button it must go to the top of the page.I'm using SMOOTHSCROLL for smother tranisition effect.

Actual behavior

For the First time it works as expected.But when I refresh the page and check it ends in error as:

An instance of PageScrollService already exists, usually including one provider should be enough, so double check.

Resources (code snippets)

<div class="content" role="main" id="top">...`</div>`

<button aria-label="Button" class="btn btn-floating btn-large color-background waves-light back-to-home"
id="scrollBtn" mdbPageScroll href="#top" mdbWavesEffect pageScrollOffset="75" [pageScrollDuration]="950">
<i class="fas fa-arrow-up"></i>
<button>

Arkadiusz Idzikowski staff commented 2 months ago

Please provide more details that will help us to reproduce this problem on our end. We tried to do that with the code that you included, but without success.


Aroquiassamy LA ROZE pro premium commented 2 months ago

Hi Arkadiusz Idzikowski, 1. I created a new Angular 9 universal project 2. Installed Md bootstrap pro version 3. I used "Smoothscroll" control in a home page 4. I serve project from dev version (npm run dev:ssr) 5. First time after page is loaded, i checked in serve terminal. There is no error 6. Press F5 in home page ( after refresh), i checked again in the serve terminal. Present new error: "An instance of PageScrollService already exists, usually including one provider should be enough, so double check."


Arkadiusz Idzikowski staff commented 2 months ago

Thank you for the details, we will try to reproduce that in app with SSR and let you know what we found.


Please insert min. 20 characters.
Status

Open

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: Angular
  • MDB Version: 9.3.1
  • Device: Lenova
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No