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

Carousel component blocking the page transition #19

Closed
elzdave opened this issue Feb 13, 2021 · 4 comments · Fixed by #25
Closed

Carousel component blocking the page transition #19

elzdave opened this issue Feb 13, 2021 · 4 comments · Fixed by #25
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@elzdave
Copy link

elzdave commented Feb 13, 2021

Hello, after a week using this component, I found out that I couldn't do any page movements from page contain this carousel component to any other page. Don't really know exactly the problem, cause the browser console render unreadable stack trace, but when I temporarily commented this carousel component, I could go to other page and vice versa. Could you help on this? Thanks in advance!

@vadimkorr
Copy link
Owner

vadimkorr commented Feb 13, 2021

Hi @elzdave,
Could you please provide more details. Do you mean that changing pages are blocked somehow?
What routing library is used?
Also stacktrace, routing library name and version would be helpful, maybe some source code snipppets...

@vadimkorr vadimkorr self-assigned this Feb 13, 2021
@elzdave
Copy link
Author

elzdave commented Feb 16, 2021

Hello @vadimkorr , I'm using Inertia.js as routing library, together with Laravel framework.

So, I make two pages, Homepage.svelte and AboutUs.svelte, together linked using Inertia.js. In the Homepage.js, I use this Svelte carousel to show image carousels on my homepage. When I try to navigate to AboutUs.svelte using Inertia link, the console.log throws error and the page simply can't move to AboutUs.svelte, but when I navigate from AboutUs.svelte to Homepage.svelte using Inertia, it can be done perfectly.

I try to attach onDestroy event on carousel, but the error seems to be happened before destroy event, and when I temporary disabled the carousel, the navigation works as intended. I attached the following error log from the browser console

Uncaught (in promise) TypeError: U is undefined
  K http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_Homepage_svelte.js?id=980576340cc025693e13:4393
  o http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_Homepage_svelte.js?id=980576340cc025693e13:4393
  transition_out http://localhost:8000/frontend/js/app.js:5103
  o http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_Homepage_svelte.js?id=980576340cc025693e13:1262
  transition_out http://localhost:8000/frontend/js/app.js:5103
  o http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_Homepage_svelte.js?id=980576340cc025693e13:1898
  transition_out http://localhost:8000/frontend/js/app.js:5103
  o http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_Homepage_svelte.js?id=980576340cc025693e13:3809
  transition_out http://localhost:8000/frontend/js/app.js:5103
  o http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_AboutUs_svelte.js?id=d76d906bf4a837a99559:1307
  transition_out http://localhost:8000/frontend/js/app.js:5103
  o http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_Homepage_svelte.js?id=980576340cc025693e13:3887
  transition_out http://localhost:8000/frontend/js/app.js:5103
  p http://localhost:8000/frontend/js/app.js:3512
  p http://localhost:8000/frontend/js/app.js:3714
  update http://localhost:8000/frontend/js/app.js:5042
  flush http://localhost:8000/frontend/js/app.js:5001
  promise callback*schedule_update http://localhost:8000/frontend/js/app.js:4971
  make_dirty http://localhost:8000/frontend/js/app.js:5816
  ctx http://localhost:8000/frontend/js/app.js:5852
  instance http://localhost:8000/frontend/js/app.js:3031
  set http://localhost:8000/frontend/js/app.js:6276
  update http://localhost:8000/frontend/js/app.js:6286
  _callee$ http://localhost:8000/frontend/js/app.js:3050
  tryCatch http://localhost:8000/frontend/js/app.js:7336
  invoke http://localhost:8000/frontend/js/app.js:7566
  defineIteratorMethods http://localhost:8000/frontend/js/app.js:7391
  asyncGeneratorStep http://localhost:8000/frontend/js/app.js:2954
  _next http://localhost:8000/frontend/js/app.js:2956
  _asyncToGenerator http://localhost:8000/frontend/js/app.js:2956
  _asyncToGenerator http://localhost:8000/frontend/js/app.js:2956
  swapComponent http://localhost:8000/frontend/js/app.js:3067
  setPage http://localhost:8000/frontend/js/app.js:191
  promise callback*setPage http://localhost:8000/frontend/js/app.js:191
  visit http://localhost:8000/frontend/js/app.js:191
  promise callback*visit http://localhost:8000/frontend/js/app.js:191
  visit http://localhost:8000/frontend/js/app.js:3324
  listen http://localhost:8000/frontend/js/app.js:4367
  m http://localhost:8000/frontend/js/app.js:3222
  mount_component http://localhost:8000/frontend/js/app.js:5782
  m http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_AboutUs_svelte.js?id=d76d906bf4a837a99559:869
  mount_component http://localhost:8000/frontend/js/app.js:5782
  m http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_AboutUs_svelte.js?id=d76d906bf4a837a99559:1263
  mount_component http://localhost:8000/frontend/js/app.js:5782
  m http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_Homepage_svelte.js?id=980576340cc025693e13:3861
  mount_component http://localhost:8000/frontend/js/app.js:5782
  p http://localhost:8000/frontend/js/app.js:3522
  p http://localhost:8000/frontend/js/app.js:3714
  update http://localhost:8000/frontend/js/app.js:5042
  flush http://localhost:8000/frontend/js/app.js:5001
  promise callback*schedule_update http://localhost:8000/frontend/js/app.js:4971
  make_dirty http://localhost:8000/frontend/js/app.js:5816
  ctx http://localhost:8000/frontend/js/app.js:5852
  instance http://localhost:8000/frontend/js/app.js:3031
  set http://localhost:8000/frontend/js/app.js:6276
  update http://localhost:8000/frontend/js/app.js:6286
  _callee$ http://localhost:8000/frontend/js/app.js:3050
  tryCatch http://localhost:8000/frontend/js/app.js:7336
  invoke http://localhost:8000/frontend/js/app.js:7566
  defineIteratorMethods http://localhost:8000/frontend/js/app.js:7391
  asyncGeneratorStep http://localhost:8000/frontend/js/app.js:2954
  _next http://localhost:8000/frontend/js/app.js:2956
  _asyncToGenerator http://localhost:8000/frontend/js/app.js:2956
  _asyncToGenerator http://localhost:8000/frontend/js/app.js:2956
  swapComponent http://localhost:8000/frontend/js/app.js:3067
  setPage http://localhost:8000/frontend/js/app.js:191
  promise callback*setPage http://localhost:8000/frontend/js/app.js:191
  visit http://localhost:8000/frontend/js/app.js:191
  promise callback*visit http://localhost:8000/frontend/js/app.js:191
  visit http://localhost:8000/frontend/js/app.js:3324
  listen http://localhost:8000/frontend/js/app.js:4367
  m http://localhost:8000/frontend/js/app.js:3222
  mount_component http://localhost:8000/frontend/js/app.js:5782
  m http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_AboutUs_svelte.js?id=d76d906bf4a837a99559:876
  mount_component http://localhost:8000/frontend/js/app.js:5782
  m http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_AboutUs_svelte.js?id=d76d906bf4a837a99559:1263
  mount_component http://localhost:8000/frontend/js/app.js:5782
  m http://localhost:8000/frontend/js/svelte/resources_frontend_js_Pages_AboutUs_svelte.js?id=d76d906bf4a837a99559:1448
  mount_component http://localhost:8000/frontend/js/app.js:5782
  m http://localhost:8000/frontend/js/app.js:3484
  p http://localhost:8000/frontend/js/app.js:3725
  update http://localhost:8000/frontend/js/app.js:5042
  flush http://localhost:8000/frontend/js/app.js:5001

I currently didn't know how to attach debugger, please be patient :)

@vadimkorr
Copy link
Owner

vadimkorr commented Feb 23, 2021

@elzdave
After some research, I found out that this svelte's issue sveltejs/svelte#3448, and it is still open.

But I found this workaround:

import Carousel from 'svelte-carousel/src/main.js'; // instead of import Carousel from 'svelte-carousel';
import 'svelte-carousel/dist/index.css';

Please check it out and let me know...

@gablittledevshop
Copy link

I just want to report I was also having the issue using sapper and the workaround worked. To use in sapper:

<script>
  let Carousel;

  onMount(async () => {
    const module = await import('svelte-carousel/src/main.js');
    Carousel = module.default;
  });
</script>

Then:

<svelte:component this={Carousel} let:loaded> ...

vadimkorr added a commit that referenced this issue Apr 28, 2021
@vadimkorr vadimkorr linked a pull request Apr 28, 2021 that will close this issue
@vadimkorr vadimkorr added the bug Something isn't working label Apr 28, 2021
vadimkorr added a commit that referenced this issue Apr 28, 2021
@vadimkorr vadimkorr added documentation Improvements or additions to documentation and removed bug Something isn't working labels Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants