Closed geysernrd closed 1 year ago
Hi @geysernrd, thanks for reporting this issue.
I was able to run the suggested command fine:
matt@matt-framework:~/dev-cit/cit/safe-template-554/src/Client$ dotnet fable watch -o output -s --run npm start
Fable: F# to JS compiler 3.7.5
Stop Russian aggression against Ukraine!
Parsing Client.fsproj...
Retrieving project options from cache, in case of issues run `dotnet fable clean` or try `--noCache` option.
Project and references (120 source files) parsed in 86ms
.> npm start
> start
> webpack-dev-server --mode development
Bundling for run - development ...
Loaded Feliz.HookAttribute from ../../../../../.nuget/packages/feliz.compilerplugins/1.8.0/lib/netstandard2.0/Feliz.CompilerPlugins.dll
Loaded Feliz.ReactComponentAttribute from ../../../../../.nuget/packages/feliz.compilerplugins/1.8.0/lib/netstandard2.0/Feliz.CompilerPlugins.dll
Loaded Feliz.ReactMemoComponentAttribute from ../../../../../.nuget/packages/feliz.compilerplugins/1.8.0/lib/netstandard2.0/Feliz.CompilerPlugins.dll
<i> [webpack-dev-server] [HPM] Proxy created: /api/** -> http://localhost:5000
<i> [webpack-dev-server] [HPM] Proxy created: /socket/** -> http://localhost:5000
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8080/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.0.31:8080/
<i> [webpack-dev-server] Content not from webpack is served from '/home/matt/dev-cit/cit/safe-template-554/src/Client/public' directory
<i> [webpack-dev-server] 404s will fallback to '/index.html'
asset vendors-node_modules_react-dom_index_js-node_modules_remotedev_lib_index_js-node_modules_webp-2931a1.js 3.29 MiB [emitted] (id hint: vendors)
asset app.js 3.01 MiB [emitted] (name: app)
asset runtime.js 43.3 KiB [emitted] (name: runtime)
asset index.html 704 bytes [emitted]
Entrypoint app 6.34 MiB = runtime.js 43.3 KiB vendors-node_modules_react-dom_index_js-node_modules_remotedev_lib_index_js-node_modules_webp-2931a1.js 3.29 MiB app.js 3.01 MiB
runtime modules 28.2 KiB 14 modules
modules by path ./src/Client/output/ 1.01 MiB
modules by path ./src/Client/output/fable_modules/fable-library.3.7.5/ 596 KiB 45 modules
modules by path ./src/Client/output/fable_modules/Fable.SimpleJson.3.23.0/*.js 164 KiB 8 modules
modules by path ./src/Client/output/fable_modules/Fable.Remoting.Client.7.19.0/*.js 30.5 KiB 5 modules
modules by path ./src/Client/output/fable_modules/Fable.Elmish.3.1.0/*.js 15.3 KiB 4 modules
modules by path ./src/Client/output/fable_modules/Thoth.Json.6.0.0/*.js 97.8 KiB 4 modules
modules by path ./src/Client/output/fable_modules/Fable.Elmish.HMR.5.2.0/*.js 6.32 KiB 3 modules
modules by path ./src/Client/output/*.js 18.8 KiB 2 modules
modules by path ./src/Client/output/fable_modules/Fable.Elmish.React.3.0.1/*.js 5.29 KiB 2 modules
modules by path ./src/Client/output/fable_modules/Fable.Elmish.Debugger.3.3.0/*.js 6.37 KiB 2 modules
modules by path ./src/Client/output/fable_modules/Fable.Parsimmon.4.1.0/*.js 35.2 KiB 2 modules
modules by path ./node_modules/ 1.22 MiB 55 modules
webpack 5.65.0 compiled successfully in 1152 ms
Fable compilation finished in 5359ms
However, having seen that you're getting errors in ./Helpers.fs and ./Build.fs, I guessed that you're running this command from the repo root. Indeed, if I do that, I see the same errors that you reported:
matt@matt-framework:~/dev-cit/cit/safe-template-554$ dotnet fable watch -o output -s --run npm start
...
./Helpers.fs(55,21): (55,39) error FSHARP: The type referenced through 'System.Collections.Immutable.IImmutableDictionary`2' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Collections.Immutable'. (code 74)
...
I'll close this issue on the assumption that things will work fine for you too if you run the command in the ./src/Client directory, but will make a PR against the docs site to make the instructions clearer. Please report back if this issue persists though.
Hi @mattgallagher92,
You're right, that was my mistake! I hadn't done this in a while and forgot I needed to change directories.
Thanks for the help!
Once I pin Fable.Elmish to version 3.1.0 (per this issue), I can run a SAFE Stack app with "dotnet run".
If I try to debug, the server starts fine, but if I use the debug command ("dotnet fable watch -o output -s --run npm run start"), these compile errors occur:
As with the Fable.Elmish error, I've confirmed that this occurs even with a new SAFE app created by the latest SAFE template.