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

[Bug Report]: Farm Not working with Svelte 5. #1935

Closed
JakubCzarlinski opened this issue Nov 12, 2024 · 2 comments
Closed

[Bug Report]: Farm Not working with Svelte 5. #1935

JakubCzarlinski opened this issue Nov 12, 2024 · 2 comments

Comments

@JakubCzarlinski
Copy link

Steps to reproduce

  1. bun create farm@latest
  2. Select svelte template.
  3. cd farm-project
  4. bun install - this installs svelte 4
  5. bun run dev - works
  6. bun install svelte@latest @sveltejs/vite-plugin-svelte@latest svelte-check@latest - this installs svelte 5
  7. bun run dev - this fails.
  8. bun run build && bun run preview - this also fails.

Example:

https://github.com/JakubCzarlinski/farm-svelte-5-issue

Reproduce link

https://github.com/JakubCzarlinski/farm-svelte-5-issue

What is actually happening?

Updating to Svelte 5 errors on page render in both dev and prod build when using Farm.

System Info

System:
    OS: Linux 6.11 CachyOS Linux
    CPU: (24) x64 AMD Ryzen 9 7900 12-Core Processor
    Memory: 49.36 GB / 61.94 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 22.9.0 - /usr/bin/node
    npm: 10.9.0 - /usr/bin/npm
    bun: 1.1.34 - ~/.bun/bin/bun
  npmPackages:
    @farmfe/core: ^1.3.0 => 1.3.33
@ErKeLost
Copy link
Member

ErKeLost commented Nov 13, 2024

in svelte 5 you should change mount method

import App from './App.svelte';
import { mount } from 'svelte';
const app = mount(App, { target: document.getElementById("app") });
export default app;

and the latest vite plugin use some not support config in farm
we will fix it

image

You can temporarily add the optional chain operator in source code

options.server?.config.experimental?. hmrPartialAccept

Of course, this will not affect build and preview its happend in development

We will find a way to fix this problem as soon as possible

its work well

image

@JakubCzarlinski
Copy link
Author

Ah my bad forgot about that. Thank you!

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