question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple components being loaded

See original GitHub issue

Resources: Before submitting an issue, please consult our docs.

Stencil version: (run npm list @stencil/core from a terminal/cmd prompt and paste output below):

@stencil/core@0.11.0

I’m submitting a … (check one with “x”) [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:

Given these routes:

<stencil-route url='/enviroment/new' component='create-enviroment-view' />
<stencil-route url='/enviroment/:id' component='enviroment-details-view' />

And a user visits the URL /enviroment/new the correct view is rendered; however the enviroment-details-view componentWillLoad will load method still gets called.

Expected behavior:

enviroment-details-view should not be instantiated.

Steps to reproduce:

Related code:

I think the above code shows it all.

Other information:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
threeaccentscommented, Sep 3, 2018

I think the issue might only occur on page refreshes if I go to the route using a <stencil-route-link> then there’s no issue.

1reaction
threeaccentscommented, Sep 3, 2018

Hey man I made a new repo replicating the bug. https://gitlab.com/rodzzlessa24/stencil-router-bug

As you can see I just created a new component new-profile and added it to the routes.

          <stencil-router>
            <stencil-route-switch scrollTopOffset={0}>
              <stencil-route url='/' component='app-home' exact={true} />
              <stencil-route url='/profile/new' component='new-profile' exact={true} />
              <stencil-route url='/profile/:name' component='app-profile' />
            </stencil-route-switch>
          </stencil-router>

I added a console.log in the componentWillLoad function of the app-profile component. If you visit /profile/new you’ll see the log message from app-profile also being logged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to load multiple components at same time in reactJs?
It should work, <Loader/> component will be shown untill all components are loaded. React lazy will not control the api calls that individual ......
Read more >
Manually Lazy Load Modules And Components In Angular
Based on this configuration data, multiple modules and/or components need to be lazy-loaded and its routes dynamically added to the application.
Read more >
How to load multiple components with the ... - Jazz.net
To load all the components in the RWS into a sandbox using the Load wiza... ... We could do it from the CLI...
Read more >
Entry components - Angular
A bootstrapped component is an entry component that Angular loads into the DOM during the bootstrap process (application launch). Other entry components are ......
Read more >
Angular: Reload/Refresh a Component or Entire Application ...
There is a lot of difference between reloading a single component and reloading the entire application. We shall see how both can be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found