-
Notifications
You must be signed in to change notification settings - Fork 3
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
svelte-kit / ssr error because of client side only library (jquery) #8
Comments
@notYou263 I was working on a fix, I will try to finish it and push the changes |
I decided to move jquery loading to a component that has to be mounted on the top level of the app, this way we don't have to wait for jquery loading each time we want to initialize a component depending on it |
I also removed the svelte await block that cause flickering |
Sounds great. A temporarily solution is, disabling ssr in hook.js file However I hope for a fix anytime soon as above method is not suitable |
#9 @notYou263 checkout the new version 0.4.0 |
As soon as I add a dropdown, following error shows up in browser console
Using a fresh installed svelte-kit skeleton, install svantic and jquery (as it isnt anymore) and my index.svelte file <script>
// import modules
import { Button, Dropdown, initDropdown, Icon, Svantic } from 'svantic';
// call this function if you want to use Module.SubModule syntax, ex: Dropdown.Item
initDropdown()
</script>
<Svantic>
<Button> A button </Button>
<Dropdown
onMount={(domElem) => {}}
settings={{}}
selection >
<Icon name="caret down" />
<Dropdown.Text>Select language</Dropdown.Text>
<Dropdown.Menu>
<Dropdown.Item>English</Dropdown.Item>
<Dropdown.Item>Arabic</Dropdown.Item>
<Dropdown.Item>Spanish</Dropdown.Item>
<Dropdown.Item>German</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
</Svantic>
And btw, there are some missing exports, MenuItem, initMenu, initTable and other table child components |
Hi,
I created a new svelte-kit app, added svantic and got some errors to deal with because of fomantics jquery depency as well as some
design problems.
I would like to discuss a possible solution for this problem.
Here is what I did to get it working.
First I had to add a typeof window check at src/modules/utils/loader.js
Then I made some changes on the components.
For example, src/modules/dropdown/dropdown.svelte
The text was updated successfully, but these errors were encountered: