Here is what I have in cmd:
c:\work\MNP\new2016\Fable>node build/fable samples/node/server
module.js:471
throw err;
^
Error: Cannot find module 'c:\work\MNP\new2016\Fablebuild\fable'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
Please help
I gave up trying to deal with all the samples. I went to samples\browser\react-tutorial.
Going through readme.md there:
ERROR in ./out/client/components.js
Module not found: Error: Cannot resolve module 'react/lib/ReactMount' in c:\work\MNP\new2016\Fable\samples\browser\react-tutorial\out\client
@ ./out/client/components.js 1:367-398
ERROR in ./out/models.js
Module not found: Error: Cannot resolve module 'react/lib/ReactMount' in c:\work\MNP\new2016\Fable\samples\browser\react-tutorial\out
@ ./out/models.js 1:367-398
webpack: bundle is now VALID.
http://localhost:8080/If I do first step not in debug mode then all seems fine. But I need to run fable every time I change code and also need to reload page.
Also why the VS project output is .exe. I wouldn't mind if it worked. But it gives another exception on startup:
An unhandled exception of type 'System.TypeInitializationException' occurred in Fable.Core.dll
Additional information: The type initializer for '
On line:
Node.require.Invoke("core-js") |> ignore
Hi @alehro, did you try building Fable first? In Windows it would be just typing build in root directory.
Fable projects are not meant to be built with the F# compiler directly. You'll get errors if you try to compile and run the .exe directly.
The new version 0.7.0 will be soon released and we are in transition to update the samples so please pardon the dust! The react-tutorial sample is a bit complex because it includes a custom server, I'd recommend starting with react-todomvc, the redux- ones, virtualdom or any of the one which include a tutorial from the web.
Hi @alfonsogarciacaro, thank you for the answer. I've just tried the "build". I get error downloading starter pack of TypeProviders. Here is full console output:
No version specified. Downloading latest stable.
Starting download from https://github.com/fsprojects/Paket/releases/download/3.29.1/paket.exe
Done.
Paket version 3.29.1
Downloading FAKE 4.40 (Docs)
Downloading FSharp.Formatting 2.14.2 (Docs)
Downloading Suave 1.1.3 (Docs)
Downloading FSharp.Compiler.Service 2.0.0.6 (Docs)
Downloading FSharpVSPowerTools.Core 2.3 (Docs)
Downloading DotLiquid 2.0.30 (Docs)
Downloading fsprojects/FSharp.TypeProviders.StarterPack:dbbfb58d1238bf21c84c455451501c7f31ae95e1 src/ProvidedTypes.fs to c:\work\MNP\new2016\Fable\paket-files\fsprojects\FSharp.TypeProviders.StarterPacksrc\ProvidedTypes.fs
Downloading fsprojects/Forge:f75374896a2894e3187e3a2909e769fb920f3af4 src/Forge.ProjectSystem/Constants.fs to c:\work\MNP\new2016\Fable\paket-files\fsprojects\Forgesrc\Forge.ProjectSystem\Constants.fs
Paket failed with:
Could not download from https://raw.githubusercontent.com/fsprojects/Forge/f75374896a2894e3187e3a2909e769fb920f3af4/src/Forge.ProjectSystem/Constants.fs
Message: One or more errors occurred.
Details: The remote server returned an error: (404) Not Found.
Are you trying to build master? I'm currently working on 0.7.0 which has a lot of changes, but I'll merge with master today or within the next week.
Yes, I use master.
git clone https://github.com/fable-compiler/Fable.git
I've just made clean check out, the error is the same.
@alehro If you pull the latest master it should build now, just keep in mind that node v7.1.0 has an issue with mocha on Windows 10, so either fall back to v7.0.0 or wait for next node release.
@ncave Thank you. Now the build works. Mocha tests also passed (I'm using node v6.9.1)
It was about general build.
The node build/fable samples/node/server now returns:
fable-compiler 0.7.8: Start compilation...
[OPTIONS ERROR] Fable version: 0.7.8
Required: ^0.6.4
Please upgrade fable-compiler package`
I actually don't mind, since I have figured out the stuff I need already.
@alehro It just means that the package.json dependency semver has not been updated yet.
Something like that should work:
"dependencies": {
"fable-core": "^0.7.7",
...
},
"engines": {
"fable": "^0.7.8"
}
It is work fine in my Windows after clone latest samples, thanks.
Samples in the repo (not yet in the website) have been upgraded to Fable 0.7. Please feel free to reopen the issue if you still have problems/questions.
Most helpful comment
@alehro It just means that the package.json dependency semver has not been updated yet.
Something like that should work: