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

dotnet fable watch stops working with --run npx vite #3791

Closed
ken-okabe opened this issue Mar 23, 2024 · 2 comments
Closed

dotnet fable watch stops working with --run npx vite #3791

ken-okabe opened this issue Mar 23, 2024 · 2 comments

Comments

@ken-okabe
Copy link

ken-okabe commented Mar 23, 2024

Description

This is my first attempt at using Fable for a serious project.
Accordingly, I have followed the steps described in Getting Started

https://fable.io/docs/getting-started/your-first-fable-project.html
https://fable.io/docs/getting-started/javascript.html

  • Node.js

dotnet fable watch

works as expected.

  • Browser

After setup, the command

dotnet fable watch --run npx vite

works as expected only 2-3 times when changes are made to Program.fs .

After that, the transpilation from Program.fs to Program.fs.js stops working, preventing Vite triggers.

dotnet fable watch alone without --run npx vite still works fine.

Repro code

All code is identical to Getting Started in the official documentation guide.

https://fable.io/docs/getting-started/your-first-fable-project.html
https://fable.io/docs/getting-started/javascript.html

Expected and actual results

dotnet fable watch alone works fine forever.

dotnet fable watch --run npx vite works only a few times, but should work forever.

Related information

  • Fable version: dotnet fable --version
    4.16.0

  • Vite version: npx vite --version
    vite/5.2.4 linux-x64 node-v21.7.1

  • Dotnet version: dotnet --version
    8.0.201

  • Operating system
    EndeavourOS (Arch Linux)


Workaround

Simply do not use

dotnet fable watch --run npx vite

Alternatively, execute the following commands simultaneously

dotnet fable watch

npx vite

@MangelMaxime
Copy link
Member

MangelMaxime commented Mar 24, 2024

Hello, this is a duplicate of #3365 and #3631

Using dotnet fable --verbose will workaround the limitation.

The problem seems to be due because both Vite and Fable rewrite the console history.

I updated the documentation to mention this problem, and point to the tracked issue.

@ken-okabe
Copy link
Author

Hi, I apologize for the duplication. I searched for the issue, but couldn't find it.
Thank you for the documentation.

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