Example CRUD with Oxpecker.Solid app fails to build Frontend
- Check out the CRUD example app
- Add the
fabledotnet tool (using the Fable docs) -
npm i -
dotnet fable watch --exclude Oxpecker.Solid.FablePlugin --noCache --extension .jsx --run vite
I get this error:
Loaded Oxpecker.Solid.SolidComponentAttribute from ..\..\..\..\..\..\..\Users\DavidFaivre\.nuget\packages\oxpecker.solid.fableplugin\0.7.0\lib\net6.0\Oxpecker.Solid.FablePlugin.dll
Started Fable compilation...
Compiled 11/11: src\App.fs
Fable compilation finished in 2146ms
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Core, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'FSharp.Core, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.ModuleHandle.ResolveType(QCallModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1& derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctorWithParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable)
at System.Reflection.CustomAttribute.IsDefined(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.IsDefined(Type attributeType, Boolean inherit)
at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat, StringBuilder sb)
at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat)
at System.Exception.get_StackTrace()
at [email protected](FSharpResult`2 _arg3) in /home/mmangel/Workspaces/Github/fable-compiler/Fable/fable4/src/Fable.Cli/Main.fs:line 1128
at [email protected](Tuple`2 _arg2) in /home/mmangel/Workspaces/Github/fable-compiler/Fable/fable4/src/Fable.Cli/Main.fs:line 1116
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, b result1, FSharpFunc`2 userCode) in /home/dev/Projects/fsharp/src/FSharp.Core/async.fs:line 528
at Microsoft.FSharp.Control.AsyncPrimitives.PostOrQueueWithTrampoline@932.Invoke(Unit unitVar0) in /home/dev/Projects/fsharp/src/FSharp.Core/async.fs:line 932
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in /home/dev/Projects/fsharp/src/FSharp.Core/async.fs:line 112
--- End of stack trace from previous location ---
at Microsoft.FSharp.Control.AsyncResult`1.Commit() in /home/dev/Projects/fsharp/src/FSharp.Core/async.fs:line 454
at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) in /home/dev/Projects/fsharp/src/FSharp.Core/async.fs:line 1139
at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in /home/dev/Projects/fsharp/src/FSharp.Core/async.fs:line 1166
at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in /home/dev/Projects/fsharp/src/FSharp.Core/async.fs:line 1515
at [email protected](Unit _arg5) in /home/mmangel/Workspaces/Github/fable-compiler/Fable/fable4/src/Fable.Cli/Entry.fs:line 391
at [email protected](Tuple`2 _arg2) in /home/mmangel/Workspaces/Github/fable-compiler/Fable/fable4/src/Fable.Cli/Entry.fs:line 523
at Fable.Cli.Entry.main(String[] argv) in /home/mmangel/Workspaces/Github/fable-compiler/Fable/fable4/src/Fable.Cli/Entry.fs:line 515
Process finished with exit code -532462766
This is a very cool project - thank you for it!
Hi! Have you installed .NET 9 SDK on your machine? Also you could just run dotnet tool restore to install fable. Also, you can try using main branch instead of develop, it uses Oxpecker.Solid from nuget rather than building from sources.
Thank you for the supportive words!
whoa, thanks for the quick response.
TLDR - it appears to break with fable tool version 4.25.0 but works with fable tool version 4.24.0
When I copied the CRUD app and re-added the dotnet tool manifest, it installed latest. When I ran directly from the repo using the checked in .config it worked. I finally tracked down the version diff.
When I manually update the checked in .config manifest to use 4.25.0 it breaks again, FWIW.
Other details to your questions:
- yes, I have the
dotnet 9.0.301installed - yes I was on the
mainbranch
I see, thank you for the investigation, I'll take a look on Monday. We might need to contact fable maintainers for that.
@dfaivre-pcs the new version of Fable with the fix has been released, can you please check if it fixes the issue?
Seems to make it past the fable compile step, but now vite build looks to be failing (using fable 4.26.0):
> build
> dotnet fable --exclude Oxpecker.Solid.FablePlugin --noCache --extension .jsx --run vite build
Fable 4.26.0: F# to JavaScript compiler
Minimum @fable-org/fable-library-js version (when installed from npm): 1.11.0
Thanks to the contributor! @selketjah
Stand with Ukraine! https://standwithukraine.com.ua/
Parsing Frontend.fsproj...
.> cmd /C dotnet restore Frontend.fable-temp.csproj -p:FABLE_COMPILER=true -p:FABLE_COMPILER_4=true -p:FABLE_COMPILER_JAVASCRIPT=true
Restore complete (0.5s)
Build succeeded in 0.9s
.> cmd /C dotnet restore C:/dev/open_src_mirr/oxpecker/Oxpecker/examples/CRUD/Frontend/Frontend.fsproj
Restore complete (0.4s)
Build succeeded in 0.7s
..\Shared> cmd /C dotnet restore C:/dev/open_src_mirr/oxpecker/Oxpecker/examples/CRUD/Shared/Shared.fsproj
Restore complete (0.2s)
Build succeeded in 0.4s
Project and references (23 source files) parsed in 4615ms
Could not scan C:/Users/DavidFaivre/.nuget/packages/oxpecker.solid.fableplugin/0.7.0/lib/net6.0/Oxpecker.Solid.FablePlugin.dll for Fable plugins, skipping this assembly. Original error: The exception has been reported. This intern
al exception should now be caught at an error recovery point on the stack. Original message: The type 'AssemblyCompanyAttribute' is required here and is unavailable. You must add a reference to assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.)
Started Fable compilation...
Compiled 23/23: src\Components\Orders.fs
Fable compilation finished in 3289ms
.> cmd /C node_modules\.bin\vite build
vite v6.2.2 building for production...
✓ 4 modules transformed.
✗ Build failed in 121ms
error during build:
Could not resolve "../fable_modules/Oxpecker.Solid.0.8.1/Tags.fs.js" from "src/Program.jsx"
file: C:/dev/open_src_mirr/oxpecker/Oxpecker/examples/CRUD/Frontend/src/Program.jsx
at getRollupError (file:///C:/dev/open_src_mirr/oxpecker/Oxpecker/examples/CRUD/Frontend/node_modules/rollup/dist/es/shared/parseAst.js:397:41)
at error (file:///C:/dev/open_src_mirr/oxpecker/Oxpecker/examples/CRUD/Frontend/node_modules/rollup/dist/es/shared/parseAst.js:393:42)
at ModuleLoader.handleInvalidResolvedId (file:///C:/dev/open_src_mirr/oxpecker/Oxpecker/examples/CRUD/Frontend/node_modules/rollup/dist/es/shared/node-entry.js:21167:24)
at file:///C:/dev/open_src_mirr/oxpecker/Oxpecker/examples/CRUD/Frontend/node_modules/rollup/dist/es/shared/node-entry.js:21127:26
Compilation failed
@dfaivre-pcs it looks like it will take a while until 4.25.0 issue is fixed. In a while you can continue using 4.24.0 or even try fable 5 alpha, I haven't tried it myself, but it might still work.