Zaid-Ajaj / Feliz

A fresh retake of the React API in Fable and a collection of high-quality components to build React applications in F#, optimized for happiness
https://zaid-ajaj.github.io/Feliz/
MIT License
534 stars 78 forks source link

[Feliz.Template] Broken with .NET 7 and nodejs 18.12.1 #538

Closed e455a81e-d3ba-41a2-bc6d-7aafb1d9a5cd closed 1 year ago

e455a81e-d3ba-41a2-bc6d-7aafb1d9a5cd commented 1 year ago

I wanted to try out Feliz, but the first time experience is really terrible at the moment. Just following the documentation I am immediately hit with a build error that Fable could not be found. This is apparently resolved by adding a global.json file as outlined here.

Having overcome that hurdle I was hit with another cryptic error:

Error: error:0308010C:digital envelope routines::unsupported

Which, I think, is caused by a mismatch between latest nodejs LTS version and the outdated webpack version referenced in the templates package.json. I found a workaround by adding an environment variable before running npm start.

$env:NODE_OPTIONS = "--openssl-legacy-provider"
Zaid-Ajaj commented 1 year ago

Hi @e455a81e-d3ba-41a2-bc6d-7aafb1d9a5cd unfortunately the template hasn't been updated in a while to reflect changes in net7.0, node and fable

First of all, since the template is built for Fable v3 in mind, it shouldn't work with net7.0 (only net6.0) so you might need a global.json setting the dotnet sdk version to v6 (6.0.400 to be specific)

About nodejs 18: updating webpack to latest should do the trick or using any other bundler

Zaid-Ajaj commented 1 year ago

Testing the latest template version 3.17.0 works like a charm with node --version v18.11.0 and dotnet --version 6.0.400

I didn't have to add any options

e455a81e-d3ba-41a2-bc6d-7aafb1d9a5cd commented 1 year ago

I will give it a try, thanks.

Zaid-Ajaj commented 1 year ago

Latest Feliz v4.4.0 template should have these problems resolved