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

Moved inline DOM functions to within constructor #843

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mindflowgo
Copy link

Server-side Rendering enabled frameworks try to run the code beforehand. Some of them like SvelteKit don't like it when inline DOM methods are present. It's a relatively light/easy fix - we just moved the few instances of these DOM methods from within the Tiny-Slider codebase into a function that is called within the TNS constructor.

No real changes to the code-base and yet the plugin can be used within SSR frameworks like SvelteKit. Thanks team!

@amanpatel
Copy link

I tried this fork but got the error "Element is not defined". I'll try to find a fix in my version of the fork.

@mindflowgo
Copy link
Author

I tried this fork but got the error "Element is not defined". I'll try to find a fix in my version of the fork.

Hmm maybe timing issue in DOM. What environment did you use it in, i can try to simulate.

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

Successfully merging this pull request may close these issues.

2 participants