safe-stack / safe-bookstore Goto Github PK
View Code? Open in Web Editor NEWWorking sample of a SAFE-Stack project with hot reloading
Home Page: https://safebookstore.azurewebsites.net/
License: The Unlicense
Working sample of a SAFE-Stack project with hot reloading
Home Page: https://safebookstore.azurewebsites.net/
License: The Unlicense
The total package size download is big - ~600MB under packages
Build and measure size of "packages" directory
Less package
Lotsa package
Build breaks after there recent Fable migration to paket/yarn from npm on Mac
./build.sh run
fails with:
dotnet fable npm-run start
dotnet watch run
No executable found matching command "dotnet-watch"
ERROR: Cannot find Fable.Compiler package. Please make sure it's been added topaket.dependencies
.
I've updated my Client.proj and Server.proj according to the latest examples but it didn't help very much.
Looks like something is wrong with the build command
I've been encountering IOExceptions pretty often while trying out the scaffold, and I think I've narrowed it down to the changes introduced in #129: there are two dotnet watch processes running, and when I change a file in the server code, they both try to generate the src/Server/bin/Debug/netcoreapp1.1/Server.runtimeconfig.json
file at the same time, resulting in one of them throwing an IOException and shutting down.
./build.sh run
in the freshly-cloned repo.dotnet watch
processes.src/Server/WebServer.fs
file and save it.dotnet watch
processes is very likely to throw an IOException.The watch processes should not interfere with each other, or there should be just a single watch process.
One of the two watch processes throws an IOException
with the error message:
System.IO.IOException: The process cannot access the file '/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/bin/Debug/netcoreapp1.1/Server.runtimeconfig.json' because it is being used by another process. [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
Full exception stack trace:
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: The "GenerateRuntimeConfigurationFiles" task failed unexpectedly. [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: System.IO.IOException: The process cannot access the file '/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/bin/Debug/netcoreapp1.1/Server.runtimeconfig.json' because it is being used by another process. [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at System.IO.UnixFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at System.IO.UnixFileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.WriteToJsonFile(String fileName, Object value) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.WriteRuntimeConfig(ProjectContext projectContext) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.ExecuteCore() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__25.MoveNext() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
The build failed. Please fix the build errors and run again.
watch : Exited with error code 1
That same stack trace, with the Microsoft.NET.Sdk.targets
path trimmed so it's easier to read:
error MSB4018: The "GenerateRuntimeConfigurationFiles" task failed unexpectedly. [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: System.IO.IOException: The process cannot access the file '/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/bin/Debug/netcoreapp1.1/Server.runtimeconfig.json' because it is being used by another process. [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at System.IO.UnixFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at System.IO.UnixFileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.WriteToJsonFile(String fileName, Object value) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.WriteRuntimeConfig(ProjectContext projectContext) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.ExecuteCore() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__25.MoveNext() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
The build failed. Please fix the build errors and run again.
watch : Exited with error code 1
If I remove unitTestsWatch
from the Run
target in build.fsx
so that there's only a single dotnet watch
process running, everything goes smoothly.
master
1.0.4
I have filled the three fields, then pressed add twice.
The first click correctly added the new book, the second click failed as seen in the screenshot:
This is the last message from the console:
There seems to be an inconsistency between the actual DOM and the model, in the model, the three textboxes are empty, but in the dom, they contain the previous values.
This occurs in both Chrome and Edge.
The project fail to build because of an error in the target.
Check out with on OSX and try to build.
The project should build.
It doesn't build. Had
Change this command: https://github.com/fable-compiler/fable-suave-scaffold/blob/master/.paket/Paket.Restore.targets#L10 to use mono on OSX.
I just made Fable.Remoting work for .NET Core 2.0 (yay! 😄)
Shall we use for this project for typed client-server communication?
@alfonsogarciacaro @forki what do you guys think?
The Apache Project explicitly disallowed the React usage in Apache Projects due licensing problems. What is the project owners and private / corporate contributors opinion about this? As far as I know most of the F# open source project prefer Apache Licence 2.0, even if this project use a different license called unlicense.
This project is great to get started with full-stack F# development, thanks!
Just to let you know, the demo link http://fable-suave.azurewebsites.net/ currently fails with a 503.
After I pull
and build.cmd
, I get this error
The library 'hostpolicy.dll' required to execute the application was not found
Please provide the steps required to reproduce the problem
Have correct prerequisities (.NET Core Preview4)
Clone the repository
Run build.cmd
,
To start the server and browser
Server is not started.
Sorry, not found.
dotnet --version
is 1.0.0-preview4-004233Login with test user failing
test should not fail
[10:31:56 INF] EXPECTO? Running tests...
[10:31:57 DBG] 127.0.0.1 connected. Now has 1 connected
[10:31:57 INF] 127.0.0.1 11504 - [19/juin/2017:08:31:57 Z] "GET / HTTP/1.1" 200 0
[10:31:57 DBG] 127.0.0.1 connected. Now has 2 connected
[10:31:57 INF] 127.0.0.1 11504 - [19/juin/2017:08:31:57 Z] "GET /css/site.css HTTP/1.1" 200 0
[10:31:57 DBG] 127.0.0.1 connected. Now has 3 connected
[10:31:57 INF] 127.0.0.1 11504 - [19/juin/2017:08:31:57 Z] "GET /js/shim.min.js HTTP/1.1" 200 0
[10:31:57 INF] 127.0.0.1 11504 - [19/juin/2017:08:31:57 Z] "GET /js/fetch.js HTTP/1.1" 200 0
[10:31:57 INF] 127.0.0.1 11504 - [19/juin/2017:08:31:57 Z] "GET /public/bundle.js HTTP/1.1" 200 0
[ERROR - 2017-06-19T08:31:57.992Z] Session [c1074bd0-54c9-11e7-880b-536a8a63c7e4] - page.onError - msg: Error parsing url
phantomjs://platform/console++.js:263 in error
[ERROR - 2017-06-19T08:31:57.997Z] Session [c1074bd0-54c9-11e7-880b-536a8a63c7e4] - page.onError - stack:
r (http://localhost:8085/public/bundle.js:20)
phantomjs://platform/console++.js:263 in error
[ERROR - 2017-06-19T08:31:58.194Z] Session [c1074bd0-54c9-11e7-880b-536a8a63c7e4] - page.onError - msg: Error parsing url
phantomjs://platform/console++.js:263 in error
[ERROR - 2017-06-19T08:31:58.202Z] Session [c1074bd0-54c9-11e7-880b-536a8a63c7e4] - page.onError - stack:
r (http://localhost:8085/public/bundle.js:20)
phantomjs://platform/console++.js:263 in error
[ERROR - 2017-06-19T08:32:03.920Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1497861123866
phantomjs://platform/console++.js:263 in error
[ERROR - 2017-06-19T08:32:05.123Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1497861125067
phantomjs://platform/console++.js:263 in error
[10:32:05 INF] 127.0.0.1 11504 - [19/juin/2017:08:32:05 Z] "POST /api/users/login HTTP/1.1" 200 259
[10:32:05 INF] 127.0.0.1 11504 - [19/juin/2017:08:32:05 Z] "GET /api/wishlist/ HTTP/1.1" 200 182
[ERROR - 2017-06-19T08:32:06.374Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1497861126320
phantomjs://platform/console++.js:263 in error
[ERROR - 2017-06-19T08:32:09.468Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1497861129412
phantomjs://platform/console++.js:263 in error
[ERROR - 2017-06-19T08:32:11.968Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1497861131912
phantomjs://platform/console++.js:263 in error
[ERROR - 2017-06-19T08:32:14.469Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1497861134413
phantomjs://platform/console++.js:263 in error
[10:32:16 ERR] client tests/login with test user errored in 00:00:18.1160000
canopy.types+CanopyWaitForException: Condition not met in given amount of time. If you want to increase the time, put compareTimeout <- 10.0 anywhere before a test to increase the timeout
waitFor condition failed to become true in 10.0 seconds
à canopy.core.waitFor2(String message, FSharpFunc2 f) dans C:\projects\canopy\src\canopy\canopy.fs:ligne 221 à [email protected](FSharpFunc
2 f) dans C:\projects\canopy\src\canopy\canopy.fs:ligne 224
à [email protected](Unit unitVar0) dans C:\yoann\Forks\fable-suave-scaffold\test\UITests\Tests.fs:ligne 34
à [email protected](Unit unitVar)
à [email protected](AsyncParams`1 args)
[10:32:16 INF] EXPECTO! 2 tests run in 00:00:19.5365623 – 1 passed, 0 ignored, 0 failed, 1 errored. ( ರ Ĺ̯ ರೃ )
[INFO [ 10:32:16 DBG-] Shutting down transport
20[110:32:16 7DBG-] 0Shutting down transport
6-[10:32:161 DBG9] TShutting down transport
08:32:16.452Z] ShutdownReqHand - _handle - About to shutdown
[10:32:16 DBG] Disconnected 127.0.0.1. 1 connected.
[10:32:16 DBG] Disconnected 127.0.0.1. 2 connected.
[10:32:16 DBG] Disconnected 127.0.0.1. 0 connected.
Running build failed.
Please provide a description of any known workarounds.
I wanted to try out how the reload of both client and server worked and it failed when changing server code. I did a minor change to defaultWishList
to get something visual out, but when it tried to reload the server it seemed like the old process were still alive since it got a conflict on the address.
defaultWishList
.NET Command Line Tools (1.0.1)
Product Information:
Version: 1.0.1
Commit SHA-1 hash: 005db40cd1
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/1.0.1
Let me know if anything more is needed.
When running build.cmd I get an error stating:
"d:\repos2\fable-suave-scaffold\test\ServerTests\Tests.fs(3,6): error FS0039: The namespace or module 'Expecto' is not defined."
From looking at the fsproj file, I cannot see where it is referenced.
Step A
git clone
Step B
run build.cmd from Command window.
I expected the build to pass without errors
There are test errors. Packages seems to be missing, although they are downloaded to packages\test\Expecto
None that I know of. I'm new to .Net core so I have no idea how to fix this.
Here is a more detailed screen dump:
//================================================================
Starting Target: BuildServerTests (==> BuildClient)
dotnet build
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Server -> d:\repos2\fable-suave-scaffold\src\Server\bin\Debug\netcoreapp2.0\Server.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.10
Finished Target: BuildServerTests
Starting Target: RunServerTests (==> BuildServerTests)
dotnet run
d:\repos2\fable-suave-scaffold\test\ServerTests\Tests.fs(3,6): error FS0039: The namespace or module 'Expecto' is not defined. [d:\repos2\fable-suave-scaffold\test\ServerTests\ServerTests.fsproj]
d:\repos2\fable-suave-scaffold\test\ServerTests\Tests.fs(7,3): error FS0039: The value or constructor 'testList' is not defined. Maybe you want one of the following:� WishList [d:\repos2\fable-suave-scaffold\test\ServerTests\ServerTests.fsproj]
d:\repos2\fable-suave-scaffold\test\ServerTests\Program.fs(3,6): error FS0039: The namespace or module 'Expecto' is not defined. [d:\repos2\fable-suave-scaffold\test\ServerTests\ServerTests.fsproj]
d:\repos2\fable-suave-scaffold\test\ServerTests\Program.fs(7,9): error FS0039: The value or constructor 'runTestsWithArgs' is not defined. [d:\repos2\fable-suave-scaffold\test\ServerTests\ServerTests.fsproj]
The build failed. Please fix the build errors and run again.
Running build failed.
Error:
System.Exception: dotnet run failed
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message)
at FSI_0005.Build.runDotnet(String workingDir, String args)
at [email protected](Unit _arg12)
at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in D:\code\fake\src\app\FakeLib\TargetHelper.fs:line 626
Target Duration
Restore failed on Ubuntu 16.04 with Error :
Starting Target: Build (==> BuildClient)
/home/thomas/.local/share/dotnetcore/dotnet restore
Failed to initialize CoreCLR, HRESULT: 0x80131500
Running build failed.
Error:
System.Exception: Restore failed
at [email protected] (Microsoft.FSharp.Core.Unit _arg4) <0x41a5b050 + 0x0017b> in :0
at Fake.TargetHelper+targetFromTemplate@195[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) <0x419de900 + 0x00023> in :0
at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) <0x419d3a00 + 0x000ca> in :0
Please provide the steps required to reproduce the problem
Clone Repository
run build.sh
Build without errors :-)
Install http://packages.ubuntu.com/de/trusty/amd64/libicu52/download
Of course i didn't read the documentation when running the build for the first time and received the following error when the build got to the Tests.sln file.
Upon rereading the instructions, I see that I was supposed to run the build with the "run" target for "development mode" and that the default build is for full Visual Studio on Windows users.
I would suggest rethinking this strategy, as users don't expect the default build script to fail. Maybe a simple app for VS Code users without sln files and simple core only fsproj files? And an advanced app for Visual Studio on Windows users where there is built in tooling for sln and fsproj files?
On the second run of ./build.sh
on macOS Sierra, the RenameDrivers task fails.
Run ./build.sh
twice.
Successful build.
Running build failed.
Error:
System.IO.IOException: Error 183
at System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) [0x00214] in <12e050e5b3d34326a1b4e2e7624e75da>:0
at System.IO.FileInfo.MoveTo (System.String destFileName) [0x0004b] in <12e050e5b3d34326a1b4e2e7624e75da>:0
at (wrapper remoting-invoke-with-check) System.IO.FileInfo:MoveTo (string)
at [email protected] (Microsoft.FSharp.Core.Unit _arg2) [0x00040] in <5d0fb7ddd1cb4823878a191f972c171f>:0
at Fake.TargetHelper+targetFromTemplate@195[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00001] in <58aaff2accf1c534a74503832affaa58>:0
at Fake.TargetHelper.runSingleTarget (Fake.TargetHelper+TargetTemplate`1[a] target) [0x00040] in <58aaff2accf1c534a74503832affaa58>:0
Manually removing test/UITests/bin/Release/chromedriver before the second run fixes the problem.
Operating system
macOS Sierra
Branch
master
.NET Runtime, CoreCLR or Mono Version
mono 4.8.0
FSharp.Formatting can be removed from deps since we don't ship docs for a website.
This will allow for huge cleanup in build.fsx
It may be a good idea to convert the repo to a template so users can create a project easily using dotnet SDK. It would still be possible to clone and use the project directly, though we have to move everything to a Content
folder (unless @enricosada knows another possibility).
What do you think? If we make this a template, maybe @MangelMaxime can help with that?
Getting error MSB4057: The target "Restore" does not exist in the project.
while dotnet restore run for projects. Same is true for server and client project.
Please provide the steps required to reproduce the problem
build.cmd
and it will work until it reaches InstallServer
and fail with above error while trying dotnet restore
.dotnet restore
. Same result.It should build and test should run.
Please provide a description of the behavior you expect.
Failing at dotnet restore
Nothing yet.
OS : Win10
VS : 2017 installed with latest update
dot net core : sdk installed 2.0.0 latest one
Note : If I try creating separate F# project using dotnet new
then dotnet restore
& dotnet build
both works. In above case even build is failing. While googling I found out that in some cases build is working just restore is failing.
Let me know if any further info is require or if there is any steps I can try to narrow down issue.
Solution and projects seems still to be named msu.SmartMeterHome. Urgs
If you build the scaffold twice in a row, the second build errors out with a message about being unable to rename chromedriver
. Reproduced on Linux Mint, won't be able to try Windows for several days, don't have a Mac to test on.
git clone https://github.com/fable-compiler/fable-suave-scaffold
cd fable-suave-scaffold
./build.sh
- succeeds./build.sh
- failsThe second build should succeed as well.
Second build fails during the RenameDrivers
target with the exception:
Running build failed.
Error:
System.Exception: Could not rename chromedriver at test/UITests/bin/Debug/net461/chromedriver. Message: Error 183
at [email protected] (System.String message) [0x00001] in <fd501e0bd6184492a524270ebab8b6fc>:0
at Microsoft.FSharp.Core.PrintfImpl+StringPrintfEnv`1[TResult].Finalize () [0x00012] in <5893d081904cf4daa745038381d09358>:0
at Microsoft.FSharp.Core.PrintfImpl+Final1@224[TState,TResidue,TResult,A].Invoke (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] env, A a) [0x00038] in <5893d081904cf4daa745038381d09358>:0
at Microsoft.FSharp.Core.OptimizedClosures+Invoke@3253[T2,TResult,T1].Invoke (T2 u) [0x00001] in <5893d081904cf4daa745038381d09358>:0
at [email protected] (Microsoft.FSharp.Core.Unit _arg11) [0x000d4] in <fd501e0bd6184492a524270ebab8b6fc>:0
at Fake.TargetHelper+targetFromTemplate@209-1[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00001] in <597b0a4fccf1c534a74503834f0a7b59>:0
at Fake.TargetHelper.runSingleTarget (Fake.TargetHelper+TargetTemplate`1[a] target) [0x0004b] in <597b0a4fccf1c534a74503834f0a7b59>:0
Error 183 is "Cannot create file when that file already exists."
To fix this, change this line in build.fsx
:
elif isLinux then
to:
elif isLinux && not <| File.Exists "test/UITests/bin/Debug/net461/chromedriver" then
I'll submit a PR for this.
master
More of question than issue. Any ideas how to deploy to Azure? I assume content of Server\bin\Debug\netcoreapp1.1
together with the Client
needs to be deployed, but I will ask first before I will dig deeper into this :-)
Editing and saving either one of the client-side .fs
files or the Client.fsproj
files does not trigger a recompile / refresh.
The default fable
template for the dotnet
CLI, meanwhile, hot-recompiles correctly.
This works (change a line in App.fs
and it recompiles instantly):
dotnet new -i Fable.Template::*
dotnet new fable -n basicTemplate
yarn install
dotnet restore
dotnet fable webpack-dev-server
This one does not:
git clone https://github.com/fable-compiler/fable-suave-scaffold
sh ./build.sh run
None so far, I've fiddled with webpack.config.js
, trying to make it as similar to the one from the basic template as possible, without success. I tried adding a plain Javascript file to the project (with a corresponding separate entry
value in webpack.config.js
) and that file does not hot-recompile either.
Meanwhile I updated the basic template to Fable 1.0.14 and it still hot-recompiled correctly, so at least it shouldn't be a Fable problem.
The environment is a minimal VM I'm setting up for web and cloud development, to avoid all the annoyances with Windows. These are the globally installed tools:
Go to login page and type "12345" now position the cursor after "2" and type "7", the cursor jumps after "5".
We should run appveyor and Travis
I have a rather small problem, after logging out the second time, I need to click on home before the login screen is shown.
So the steps to reproduce:
click “Logout”, -> Welcome page is shown
click “Login” -> Login page shown, logging in
click “Logout” -> click Login welcome page is still shown
I have to click “Home” and then “Login” again to display the Login page.
If I open a new page and open localhost:8080, it is also after the second “Logout”, that I have to press “home” before the login is displayed.
I can reproduce it with Chrome Version 59.0.3071.115 (64-Bit)
and IE Version 11.0.9600.18665.
It is not big issue for me, but I know some people who think, if that does not work what is with the rest.
When I run build.cmd RunTests
again (?), it fails, because the user is already logged in (?)
Please provide the steps required to reproduce the problem
Step A - run build.cmd RunTests
Step B - run build.cmd RunTests
The test client tests/login with test user
should be green
The test fails
Logout the user first (PR coming in a minute)
Not able to do setup properly
Error log:
https://gist.github.com/parthmshukla/af569f011a106f5157d805ec53466be6
@forki Please look into this.
Hi together,
I get the following error when running the build.cmd
script:
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 93.184.221.200:443
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.WebClient.DownloadFile(Uri address, String fileName)
at System.Net.WebClient.DownloadFile(String address, String fileName)
at [email protected](Unit unitVar)
at [email protected](Unit _arg3)
at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 492
@vasily-kirichenko opened a similar issue at #64 however in my case I'm not behind a proxy and the error seams to be about some incorrect permissions.
Did you face that problem before or do you know about it? Do you have some hint about how to resolve it?
If you need further information pls let me know.
Thanks in advance.
Since it's scaffold I'd expect it to have unit tests projects separate from UITests.
I could add backend test example via expecto but no idea how to deal with it on Fable side.
What do you think?
The recent release of Suave 2.2.x includes a breaking change that, among other things, hides the YoLo.fs
file from user code (so its functions are only exposed internally to Suave, and not to end-user code that consumes the Suave library).
This causes one line of the scaffold to break: in Auth.fs
, there's a function that uses UTF8.bytes
:
let UNAUTHORIZED s = unauthorized (UTF8.bytes s)
UTF8.bytes
comes from YoLo.fs
, so it's not accessible once you move to Suave 2.2.0 or later. The fix is to replace that line with:
let UNAUTHORIZED (s : string) = unauthorized (System.Text.Encoding.UTF8.GetBytes s)
Alternately, since the unauthorized
and UNAUTHORIZED
functions are already defined in Suave.RequestErrors
, they could simply be deleted from Auth.fs
, making the solution even simpler.
How do you guys feel about using less or sass CSS-frameworks which is common in most modern web projects?
Is it too distracting trying add too many things to the scaffold?
Currently our canopy UI tests are only doing a mic check and a simple login.
We should add a handful of real UI tests.
PRs welcome
https://github.com/fable-compiler/fable-suave-scaffold/blob/master/test/UITests/Tests.fs
Machine info:
Vendors reported build.cmd
failing with this:
1) Fake.UnitTestCommon+FailedTestsException: Expecto test of assembly 'C:\Users\ddltd1\source\repos\fable-suave-scaffold\test\UITests\bin\Debug\net461\UITests.exe' failed. Process finished with exit code -2146232576.
at Fake.Testing.Expecto.Expecto(FSharpFunc`2 setParams, IEnumerable`1 assemblies) in D:\code\fake\src\app\FakeLib\UnitTest\Expecto\Expecto.fs:line 126
at [email protected](Unit _arg13) in C:\Users\ddltd1\source\repos\fable-suave-scaffold\build.fsx:line 182
at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in D:\code\fake\src\app\FakeLib\TargetHelper.fs:line 626
Running build failed.
Error:
System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
at System.Net.WebClient.DownloadFile(Uri address, String fileName)
at System.Net.WebClient.DownloadFile(String address, String fileName)
at [email protected](Unit unitVar)
at [email protected](Unit _arg3)
at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 492
I would like to run the app as a standard .NET app. What changes are necessary to make that work. Just changing the netcoreapp1.1 in Server.fsproj to netstandard1.6 or NET does not seem to work. I'm trying to use Suave.OAuth, which appears to only work with full .NET.
netcoreapp1.1
in Server.fsproj
to net461
I would expect this to allow me to build and run the Server project as a standard .NET app.
The build fails with the following output:
C:\Users\Paul\AppData\Local\dotnetcore\sdk\1.0.0-rc3-004530\NuGet.targets(97,5): error : Package System.Security.Cryptography.OpenSsl 4.3.0 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package System.Security.Cryptography.OpenSsl 4.3.0 supports: netstandard1.6 (.NETStandard,Version=v1.6) [C:\Tachyus\fable-suave-scaffold\src\Server\Server.fsproj]
C:\Users\Paul\AppData\Local\dotnetcore\sdk\1.0.0-rc3-004530\NuGet.targets(97,5): error : Package Microsoft.FSharp.Core.netcore 1.0.0-rc-170122 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package Microsoft.FSharp.Core.netcore 1.0.0-rc-170122 supports: netstandard1.6 (.NETStandard,Version=v1.6) [C:\Tachyus\fable-suave-scaffold\src\Server\Server.fsproj]
C:\Users\Paul\AppData\Local\dotnetcore\sdk\1.0.0-rc3-004530\NuGet.targets(97,5): error : One or more packages are incompatible with .NETFramework,Version=v4.6.1. [C:\Tachyus\fable-suave-scaffold\src\Server\Server.fsproj]
Update I found that using a real TargetVersion
helps and am now using net461
. Now I see the above issue with System.Security.Cryptography.OpenSsl
. Is there a good way to replace this?
I don't know of any workarounds.
build.cmd
Right now, the scaffold uses Suave.AspNetCore as a dependency to run the suave application with kestrel as the webserver.
Kestrel has a lot of support and is very quick, which is a good thing.
But I'm not sure about the implications that this has on a larger application.
My only concern stems from https://github.com/dustinmoris/Suave.AspNetCore#error-handling-and-other-suave-config-settings
Suave.AspNetCore allows you to hook a Suave web application (WebPart) into the ASP.NET Core pipeline. Anything that was configured in the SuaveConfig was web server specific and required to run Suave's own web server via startWebServer. In ASP.NET Core there are other means to configure the same settings. For more information please check out the ASP.NET Core Fundamentals.
So we possible lose some suave config, but gain some aspnet kestrel config? Has anyone tried hooking up logary, or other working suave config settings to make sure that the api surface is similar/compatible.
While I don't doubt that Kestrel is a really good web server, I just want to make sure it is the right precedent to be setting, since it's possible to run suave on aspnet core without kestrel, and keep all of the configuration in the suave webserver.
For some reason the build can't find fsharp.build.dll on mono. Will take a look on Monday
Since this has a great chance to become the "this is the way to do it" project, we should add expecto tests and canopy as a sample.
I took a look over the repo. It's looking great. Moving to the 1.0 SDK of .NET Core really helped
Could we track the reasons why Mono or .NET Framework are needed and link to any WIP issues in the relevant repos?
I'm just wondering what's remaining to lift that dependency.
thanks
don
Hi guys! And thanks for an absolutely fantastic project!
Having an annoying issue when running it in Visual Studio Code.
Only applies to the Server project.
It all builds and runs fine but the editor itself doesn't recognise (highlights opens with red) namespaces imported with paket in Server.fs and Program.fs but doesn't complain and works well in Shared/Domain.fs.
No issues with Client project either.
Is it something wrong with my setup or a common issue?
Tried on both Mac and Win.
Paket version 3.36.0
0 seconds - ready.
Building project with version: LocalBuild
Shortened DependencyGraph for Target All:
<== All
<== RunTests
<== RenameDrivers
<== BuildTests
<== Build
<== BuildClient
<== AssemblyInfo
<== InstallClient
<== InstallDotNetCore
<== Clean
The resulting target order is:
- Clean
- InstallDotNetCore
- InstallClient
- AssemblyInfo
- BuildClient
- Build
- BuildTests
- RenameDrivers
- RunTests
- All
Starting Target: Clean
Deleting contents of bin
Deleting contents of temp
Deleting contents of docs/output
Deleting contents of ./deploy
Deleting contents of E:\github\fable-suave-1\src\Client\public/bundle
Finished Target: Clean
Starting Target: InstallDotNetCore (==> Clean)
C:\Users\kirichenko.KL\AppData\Local\dotnetcore\dotnet.exe --version
dotnetcli 1.0.0-rc4-004771 already installed
Finished Target: InstallDotNetCore
Starting Target: InstallClient (==> InstallDotNetCore)
C:\Program Files\nodejs\npm.cmd install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
Finished Target: InstallClient
Starting Target: AssemblyInfo (==> InstallClient)
Created AssemblyInfo file "E:\github\fable-suave-1\src\Client\AssemblyInfo.fs".
Created AssemblyInfo file "E:\github\fable-suave-1\src\Server\AssemblyInfo.fs".
Finished Target: AssemblyInfo
Starting Target: BuildClient (==> AssemblyInfo)
C:\Program Files\nodejs\npm.cmd run build
> [email protected] build E:\github\fable-suave-1\src\Client
> node ../../node_modules/fable-compiler --target production
fable-compiler 0.7.46: Start compilation...
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `node ../../node_modules/fable-compiler --target production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'node ../../node_modules/fable-compiler --target production'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the navigation package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ../../node_modules/fable-compiler --target production
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs navigation
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls navigation
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! E:\github\fable-suave-1\src\Client\npm-debug.log
Running build failed.
Error:
System.Exception: Error while running 'C:\Program Files\nodejs\npm.cmd' with args: run build
at FSI_0005.Build.run'@57-3.Invoke(String message) in E:\github\fable-suave-1\build.fsx:line 57
at FSI_0005.Build.run'(TimeSpan timeout, String cmd, String args, String dir) in E:\github\fable-suave-1\build.fsx:line 57
at [email protected](String cmd, String args, String dir) in E:\github\fable-suave-1\build.fsx:line 59
at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 492
---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target Duration
------ --------
Clean 00:00:00.0052332
InstallDotNetCore 00:00:00.5821592
InstallClient 00:00:03.5400649
AssemblyInfo 00:00:00.0219934
Total: 00:00:06.2803863
Status: Failure
---------------------------------------------------------------------
1) System.Exception: Error while running 'C:\Program Files\nodejs\npm.cmd' with args: run build
at FSI_0005.Build.run'@57-3.Invoke(String message) in E:\github\fable-suave-1\build.fsx:line 57
at FSI_0005.Build.run'(TimeSpan timeout, String cmd, String args, String dir) in E:\github\fable-suave-1\build.fsx:line 57
at [email protected](String cmd, String args, String dir) in E:\github\fable-suave-1\build.fsx:line 59
at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 492
---------------------------------------------------------------------
Hey together,
when I checkout the repo and run build.cmd run
everything builds fine but when I then try to login into the sample application I get the following error on the console:
[HPM] Error occurred while trying to proxy request /api/users/login from localhost:8080 to http://localhost:8085 (ECONNREFUSED) (https://node
js.org/api/errors.html#errors_common_system_errors)
The build output states the the server was started on port 61225 (not 8085 as specified in Server/Server.fs
).
...
Finished Target: InstallClient
Starting Target: Run (==> InstallClient)
C:\Users\X\AppData\Local\dotnetcore\dotnet.exe fable npm-run start
C:\Users\X\AppData\Local\dotnetcore\dotnet.exe watch run
Fable server started on port 61225
CWD: C:\Users\sschmid\Desktop\fable-suave-scaffold\src\Client
cmd /C npm run start
watch : Started
...
The client also outputs the error:
POST http://localhost:8080/api/users/login 504 (Gateway Timeout)
I've already tried to rewire the ports of the webpack devserver proxy and the suave server but that didn't help.
Did anyone else encounter this problem? Or Do you have an idea on how to fix it?
Thanks!
In the manual validation that our vendors are doing, I had bad repro steps and didn't explicitly call out that Node and Yarn are requirements. This resulted in a manual test failure (couldn't find node.exe
) after running build.cmd
on a fresh Windows machine with no other dependencies.
I've since updated those steps to include downloading them as dependencies, but I wonder if it's possible to automatically install Node, Yarn, and Mono (if on a non-Windows machine) if they're not present. Windows already comes with an installation of .NET Framework, so this should work there too. That way the story would be the same for any machine: download/clone and build.cmd
/build.sh
.
When running build.cmd
I got this error '.paket\paket.exe'
is not recognized as an internal or external command.
./build.sh run
if you hit enter on "webpack: Compiled successfully." it says Process terminated, it really ends the app serving on localhost:8080 but it does not end the process. It keeps working until you Control-C which causes an exception to be shown.
The enter key is a usability problem imho, because you want the window open because you want to see the http traffic arriving on the server. I accidentaly press enter and have to start over.
There are times that the "Compiled successsfully" is not shown. It stucks at 95%, but odily if you refresh the browser it is working. (some terminal buffering issue I suppose)
This looks awesome. I am excited to try it out sometime soon. I've been doing something very similar, sharing the domain model in .fs files referenced by both Fable .fsx and ASP.NET. The whole thing makes for a very appealing developer experience.
One question, and I'm not even sure if I'm asking it right, but I wanted to try to start a conversation:
Does the F# web stack have any support for server-side rendering?
(e.g. what PHP or ASP.NET Razor do (I think)?)
I don't have any specific need for it, and I'm honestly not familiar at all with the interaction between server-side rendering and single-page-app-type design, as I haven't yet done any non-toy work with SPAs - but it's obviously something that's very widely used in the world, and it's really the only gap I see in the pure F# web development story.
I'm also not that familiar with Suave, so I don't know whether this is part of what it offers, and if so how the server-side-rendering part would interact with Fable.
Curious to hear your thoughts, and keep up the awesome work!
One thing that annoys me a bit is the kind of duplication that we have in https://github.com/fable-compiler/fable-suave-scaffold/blob/master/src/Client/App.fs#L101:L124
In bigger elmish apps this nested pattern match and rebuilding comes brutally repetitive.
/cc @dsyme @et1975 @alfonsogarciacaro does anyone see a way to make it nicer?
We have a very simple Dockerfile that just tries to dockerize an already "published" .NETCore app:
FROM microsoft/dotnet:1.1.0-sdk-msbuild-rc4
COPY . .
ENTRYPOINT ["dotnet", "Server.dll"]
you can create the image with:
build.cmd publish
If you then run the container with:
docker run -it --rm forki/fable-suave
It fails with the error:
Error: assembly specified in the dependencies manifest was not found -- package: 'fsharp.core', version: '4.1.0', path: 'lib/netstandard1.6/FSharp.Core.dll'
This is technically correct, but I you do the following it works:
cd deploy
dotnet Server.dll
So something inside the Dockerfile is causing the runtime to look at different place.
There are current build artifacts such as bin and obj folders are still included in vscode.
We should include a workspace config files to exclude these folders. Most of the exclusions can just be copied from .gitignore file.
Thoughts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.