Skip to content

Sample doesn't compile #52

Open
Open
@ImaginaryDevelopment

Description

@ImaginaryDevelopment

Description

Following the code from https://elmish.github.io/react/native.html does not compile

Repro code

steps

  1. create paket.dependencies from https://github.com/elmish/react/blob/v3.x/paket.dependencies
  2. dotnet new fable
  3. dotnet tool install paket - and remove the nuget references inside App.fsproj
  4. dotnet paket convert-from-nuget --force
  5. manually add the files from paket.dependencies to paket.references
  6. dotnet paket install
  7. npm install
  8. npm start -> runs just fine
  9. change the App.fs to match the Fable React Elmish sample code -> No Compilation
    fable-elmish-react-fail.zip
source https://nuget.org/api/v2
storage: none
nuget Fable.Browser.Dom 2.2.0
nuget Fable.Elmish.React
nuget FSharp.Core redirects:force, content:none
nuget Fable.Core 3.2.3
nuget Fable.React
nuget Fable.Elmish

paket.references

Fable.Browser.Dom
Fable.Elmish.React
FSharp.Core
Fable.Core
Fable.React
Fable.Elmish

Expected and actual results

Expected dotnet build and npm start still work

Actual

Description

Following the code from https://elmish.github.io/react/native.html does not compile

Repro code

steps

  1. create paket.dependencies from https://github.com/elmish/react/blob/v3.x/paket.dependencies
  2. add Fable.React.Elmish
  3. dotnet new fable
  4. dotnet tool install paket
  5. dotnet paket convert-from-nuget --force
  6. manually add the files from paket.dependencies to paket.references
  7. paket install
  8. npm install
  9. npm start -> runs just fine
  10. change the App.fs to match the Fable React Elmish sample code -> No Compilation
source https://nuget.org/api/v2
storage: none
nuget Fable.Elmish.React
nuget FSharp.Core redirects:force, content:none
nuget Fable.Core
nuget Fable.React
nuget Fable.Elmish

paket.references

FSharp.Core
Fable.Core
Fable.React
Fable.Elmish
Fable.Elmish.React

Expected and actual results

Expected dotnet build and npm start still work

Actual

Neither works, both complain about missing namespaces

>dotnet build
Microsoft (R) Build Engine version 16.9.0+57a23d249 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Paket version 5.257.0
  The last restore is still up to date. Nothing left to do.
  Performance: - Runtime: 120 milliseconds
  Paket version 5.257.0
  Starting restore process.
  Performance: - Runtime: 784 milliseconds
  Restored D:\projects\insertprojectnamehere\App.fsproj (in 147 ms).
D:\projects\insertprojectnamehere\App.fs(16,19): error FS0039: The namespace 'ReactNative' is not defined. [D:\projects\insertprojectnamehere\App.fsproj]
D:\projects\insertprojectnamehere\App.fs(17,12): error FS0039: The namespace 'Helpers' is not defined. [D:\projects\insertprojectnamehere\App.fsproj]
D:\projects\insertprojectnamehere\App.fs(21,5): error FS0039: The value or constructor 'text' is not defined. Maybe you want one of the following:↔   Text↔   exn↔   exp↔   exn [D:\projects\insertprojectnamehere\App.fsproj]
D:\projects\insertprojectnamehere\App.fs(27,8): error FS0039: The value or constructor 'touchableHighlightWithChild' is not defined. [D:\projects\insertprojectnamehere\App.fsproj]
D:\projects\insertprojectnamehere\App.fs(40,5): error FS0039: The value or constructor 'view' is not defined. [D:\projects\insertprojectnamehere\App.fsproj]

Build FAILED.

D:\projects\insertprojectnamehere\App.fs(16,19): error FS0039: The namespace 'ReactNative' is not defined. [D:\projects\insertprojectnamehere\App.fsproj]
D:\projects\insertprojectnamehere\App.fs(17,12): error FS0039: The namespace 'Helpers' is not defined. [D:\projects\insertprojectnamehere\App.fsproj]
D:\projects\insertprojectnamehere\App.fs(21,5): error FS0039: The value or constructor 'text' is not defined. Maybe you want one of the following:↔   Text↔   exn↔   exp↔   exn [D:\projects\insertprojectnamehere\App.fsproj]
D:\projects\insertprojectnamehere\App.fs(27,8): error FS0039: The value or constructor 'touchableHighlightWithChild' is not defined. [D:\projects\insertprojectnamehere\App.fsproj]
D:\projects\insertprojectnamehere\App.fs(40,5): error FS0039: The value or constructor 'view' is not defined. [D:\projects\insertprojectnamehere\App.fsproj]
    0 Warning(s)
    5 Error(s)

Time Elapsed 00:00:04.11

Related information

  • elmish version: 3.1 (Fable.Elmish.React 3.0.1)
  • fable-compiler version: where is this stored?
  • fable-core version: Fable.Core 3.2.7
  • Operating system: Windows 10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions