Code Monkey home page Code Monkey logo

Comments (4)

zaaack avatar zaaack commented on July 19, 2024 1

@alfonsogarciacaro After running dotnet build in Fable.React, I can see the error messages now, not sure why they didn't appear before. I just create a pr to fix this. #83

from fable-react.

alfonsogarciacaro avatar alfonsogarciacaro commented on July 19, 2024

Hmm, one of the errors happens because of these lines (for server rendering):

let tag = tag :?> System.Type
let comp = System.Activator.CreateInstance(tag, props)
let childrenProp = tag.GetProperty(ChildrenName)

It can be fixed by making all packages in the repo target netstandard2.0. It shouldn't be an issue but I wonder why it worked before, any idea @zaaack?

from fable-react.

zaaack avatar zaaack commented on July 19, 2024

@alfonsogarciacaro Do you have full error trace? I cannot reproduce this with the master branch.

from fable-react.

alfonsogarciacaro avatar alfonsogarciacaro commented on July 19, 2024

@zaaack Yes, Maxime posted it on his first comment. The relevant part is:

/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.Helpers.React.fs(786,36): error FS0039: Le champ, le constructeur ou le membre 'GetProperty' n'est pas défini. Peut-être souhaitez-vous l'unedes options suivantes :   GetTypeCode [/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.React.fsproj]
/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.Helpers.React.fs(787,13): error FS0072: Recherche d'un objet de type indéterminé basé sur des informations situées avant ce point du programme. Une annotation de type peut être nécessaire avant ce point du programme pour contraindre le type de l'objet. Cela peut permettre la résolution de la recherche. [/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.React.fsproj]
/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.Helpers.React.fs(788,30): error FS0039: Le champ, le constructeur ou le membre 'GetMethod' n'est pas défini. [/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.React.fsproj]
/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.Helpers.React.fs(789,13): error FS0072: Recherche d'un objet de type indéterminé basé sur des informations situées avant ce point du programme. Une annotation de type peut être nécessaire avant ce point du programme pour contraindre le type de l'objet. Cela peut permettre la résolution de la recherche. [/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.React.fsproj]
/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.Helpers.React.fs(789,13): error FS0008: Ce forçage de type ou test de type au moment de l'exécution du type    'a     en     ReactElement    implique un type indéterminé basé sur des informations situées avant ce point du programme. Les tests de types au moment de l'exécution ne sont pas autorisés sur certains types. Des annotations de type supplémentaires sont nécessaires. [/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.React.fsproj]
/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.Helpers.React.fs(794,26): error FS0039: Le champ, le constructeur ou le membre 'GetProperty' n'est pas défini. Peut-être souhaitez-vous l'unedes options suivantes :   GetTypeCode [/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.React.fsproj]
/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.Helpers.React.fs(798,44): error FS0039: Le champ, le constructeur ou le membre 'GetProperties' n'est pas défini. Peut-être souhaitez-vous l'une des options suivantes :   GetRuntimeProperties   get_IsPointer   GetRuntimeProperty [/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.React.fsproj]
/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.Helpers.React.fs(800,24): error FS0072: Recherche d'un objet de type indéterminé basé sur des informations situées avant ce point du programme. Une annotation de type peut être nécessaire avant ce point du programme pour contraindre le type de l'objet. Cela peut permettre la résolution de la recherche. [/Users/mangelmaxime/Workspace/Github/fable-compiler/fable-react/src/Fable.React/Fable.React.fsproj]

It's failing because GetProperty is not a member of Type. This is because MSFT originally wanted to cut down on reflection capabilities when doing GetType (I think it was for native compilation) and force you to use GetTypeInfo, but they added the API back in netstandard2.0. I don't know how I managed to publish the package before, maybe it depends on the dotnet SDK version used? /shrug

from fable-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.