-
Notifications
You must be signed in to change notification settings - Fork 301
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
Strange error with fable watch #2478
Comments
The main difference I see, is that when using For example, this is the case if you are using https://github.com/elmish/hmr/blob/master/src/hmr.fs#L168-L224 |
Ah, thanks for that :-) So it's likely that this is something that e.g. Elmish HMR is spitting out or similar. What's the best way to move forward on this - should I just create a basic Fable Elmish app that is configured for vite to repro the issue? |
As @MangelMaxime says it may be Elmish.HMR not being compatible with Vite so you can try commenting out the |
BTW, I've also been playing recently with Snowpack. Not sure what's the difference with ViteJS but if I'm not mistaken they follow the same idea of avoiding bundling in development to make hot reloading faster. I'm not sure if Elmish.HMR works but at least React state with the fast refresh plugin works (I assume also Feliz |
@alfonsogarciacaro I think that standard development mode in Vite doesn't bundle, but yes, let me try removing the debugging and explicit HMR and other stuff piece by piece to see what's changed. |
@isaacabraham Is this still an issue. Can you please try with latest Fable and Elmish.HMR and disabling Elmish.Debugger? |
@isaacabraham is this not related to the fact that vite doesn't define a global field? |
Indeed, it is fixed when adding these lines to the index.html <!-- Polyfill for remotedev -->
<script type="text/javascript">
var global = global || window;
</script> I am closing as there is nothing to do on Fable side. |
Description
I've been experimenting with ViteJS as an alternative method of bundling and running the client portion of SAFE Stack apps, and even I have managed to get something up and running. However, I've gotten stuck on one issue:
If I run my Fable app using
dotnet fable --run vite
everything is good, but as soon as I try to turn on watch mode on fable i.e.dotnet fable watch --run vite
, I get a problem: although the compiler works and vite hooks in, the app in the browser doesn't do anything. In the console, I get the following call stack:I have no clue what this is, but as soon as I revert to
dotnet fable --run
everything just works.Repro code
I've not got a publicly available repo available but can make one. But before doing that, I just wanted to see if they are differences between
fable --run
andfable watch --run
that you think could possibly cause this.Related information
The text was updated successfully, but these errors were encountered: