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

Calendar not loading with v0.14.1 and SvelteKit v1.0.0 #72

Closed
i-am-gizm0 opened this issue Dec 29, 2022 · 6 comments
Closed

Calendar not loading with v0.14.1 and SvelteKit v1.0.0 #72

i-am-gizm0 opened this issue Dec 29, 2022 · 6 comments

Comments

@i-am-gizm0
Copy link

I'm trying to set up the most basic example but I'm running into problems:

<script lang="ts">
    import Calendar from '@event-calendar/core';
    import TimeGrid from '@event-calendar/time-grid';

    let plugins = [TimeGrid];
    let options = {
        view: 'timeGridWeek',
        events: []
    };
</script>

<Calendar {plugins} {options} />

When I load the page, I get a few errors in the console that seem to be within the calendar:

Uncaught (in promise) TypeError: node is undefined
    attr index.mjs:448
    p index.js:1356
    update index.mjs:1193
    flush index.mjs:1160
    promise callback*schedule_update index.mjs:1118
    tick index.mjs:1122
    events index.js:266
    sync index.mjs:77
    derived index.mjs:95
    subscribe2 index.mjs:48
    events index.js:342
    State index.js:378
    instance index.js:1400
    init index.mjs:2002
    Calendar index.js:1556
    create_fragment +page.svelte:25
    init index.mjs:2017
    Page +page.svelte:98
    createProxiedComponent svelte-hooks.js:341
    ProxyComponent proxy.js:242
    Proxy<+page> proxy.js:349
    construct_svelte_component_dev index.mjs:2218
    create_default_slot root.svelte:239
    create_slot index.mjs:69
    create_fragment layout.svelte:21
    init index.mjs:2017
    Layout layout.svelte:97
    createProxiedComponent svelte-hooks.js:341
    ProxyComponent proxy.js:242
    Proxy<Layout> proxy.js:349
    construct_svelte_component_dev index.mjs:2218
    create_if_block_2 root.svelte:146
    create_fragment root.svelte:433
    init index.mjs:2017
    Root root.svelte:633
    createProxiedComponent svelte-hooks.js:341
    ProxyComponent proxy.js:242
    Proxy<Root> proxy.js:349
    initialize client.js:374
    _hydrate client.js:1620
    start start.js:39
    <anonymous> calendar:105
index.mjs:448:8
    attr index.mjs:448
    p index.js:1356
    update index.mjs:1193
    flush index.mjs:1160
    (Async: promise callback)
    schedule_update index.mjs:1118
    tick index.mjs:1122
    events index.js:266
    sync index.mjs:77
    derived index.mjs:95
    subscribe2 index.mjs:48
    events index.js:342
    State index.js:378
    instance index.js:1400
    init index.mjs:2002
    Calendar index.js:1556
    create_fragment +page.svelte:25
    init index.mjs:2017
    Page +page.svelte:98
    createProxiedComponent svelte-hooks.js:341
    ProxyComponent proxy.js:242
    Proxy<+page> proxy.js:349
    construct_svelte_component_dev index.mjs:2218
    create_default_slot root.svelte:239
    create_slot index.mjs:69
    create_fragment layout.svelte:21
    init index.mjs:2017
    Layout layout.svelte:97
    createProxiedComponent svelte-hooks.js:341
    ProxyComponent proxy.js:242
    Proxy<Layout> proxy.js:349
    construct_svelte_component_dev index.mjs:2218
    create_if_block_2 root.svelte:146
    create_fragment root.svelte:433
    init index.mjs:2017
    Root root.svelte:633
    createProxiedComponent svelte-hooks.js:341
    ProxyComponent proxy.js:242
    Proxy<Root> proxy.js:349
    initialize client.js:374
    _hydrate client.js:1620
    AsyncFunctionNext self-hosted:807
    (Async: async)
    start start.js:39
    <anonymous> calendar:105

The weirdest part is that the calendar starts to display with styles then the errors are thrown and the styles all disappear
Screen Shot 2022-12-29 at 14 46 08

@i-am-gizm0
Copy link
Author

Bare minimum repo to demonstrate the issue:
https://github.com/i-am-gizm0/event-calendar-problem-demo

@vkurko
Copy link
Owner

vkurko commented Dec 30, 2022

I looked and the last time I checked the calendar with SvelteKit, its version was 1.0.0-next.282. Most likely, something has changed on the SvelteKit side that this has now stopped working. I will try to sort out the problem after the new year 😄

@vkurko
Copy link
Owner

vkurko commented Dec 30, 2022

The problem is most likely related to a recent change in SvelteKit, namely that they decided to deprecate the svelte field in package.json. And it seems that it is no longer possible to ship both the compiled version and the Svelte source files (which are used in SvelteKit) in the same package.

So I will have to split the package into two - one for Svelte and the other for vanilla JS 😕

@i-am-gizm0
Copy link
Author

Well that's annoying! Good luck :/

@vkurko
Copy link
Owner

vkurko commented Jan 2, 2023

Hey @i-am-gizm0

Apparently they then changed their minds about removing the ability to supply compiled files along with the source files and implemented this feature a little differently.

I used this feature in version 0.14.2 and everything seems to work as it should. Please check.

@vkurko
Copy link
Owner

vkurko commented Jan 10, 2023

I hope I can close this issue. And thank you for the prepared demo, which helped to solve the problem.

@vkurko vkurko closed this as completed Jan 10, 2023
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

No branches or pull requests

2 participants