GithubHelp home page GithubHelp logo

Comments (21)

fabian-hiller avatar fabian-hiller commented on May 22, 2024 1

I believe I have fixed the problem with v0.8.4 now. Although File extends Blob, it seems that TypeScript v4.9.3 no longer maps T extends File correctly. I have implemented a workaround for now.

from modular-forms.

durandj avatar durandj commented on May 22, 2024 1

The fix worked, thanks @fabian-hiller !

from modular-forms.

ikapo avatar ikapo commented on May 22, 2024 1

Can confirm it fixed it for me as well. Thanks @fabian-hiller for the quick responses and a great library!

from modular-forms.

fabian-hiller avatar fabian-hiller commented on May 22, 2024

That is interesting. I also have strict set to true. Even in the tsconfig.js of Modular Forms. Does skipLibCheck set to true help maybe? Otherwise, can you send me the link to the Stackblitz project?

from modular-forms.

alexss3 avatar alexss3 commented on May 22, 2024

Adding skipLibCheck: false didn't change anything. The Stackblitz I'm referring to is just based on the Solid/Typescript template from their front page, which I downloaded and added the other dependencies/config manually. I could perhaps make a repo with just that if you like.

from modular-forms.

fabian-hiller avatar fabian-hiller commented on May 22, 2024

false is the default value. Please test it with skipLibCheck: true. Yes a repo would be helpful.

from modular-forms.

alexss3 avatar alexss3 commented on May 22, 2024

Sorry, meant to say true when I wrote that. In any case, I tried it with both true/false and neither worked. Here is a repo of the sample project. You should see the error in App.tsx and when you change strict: true in tsconfig.json the error should go away.
https://github.com/alexss3/solid-modular-forms

from modular-forms.

fabian-hiller avatar fabian-hiller commented on May 22, 2024

I could not reproduce it. No error occurs for me. I cloned the repository and strict was already true. Maybe try to update your packages to the latest version.

from modular-forms.

alexss3 avatar alexss3 commented on May 22, 2024

Ok, I just tried it on my personal laptop and got the same error message. I probably have a very similar setup with VS Code and could be the cause, though I'm not exactly sure what I should look for to find the root cause of it.

On my laptop I disabled a couple extensions [Javascript and TypeScript Nightly, Prettier] and saw it go away, but can't reproduce the symptom to know which one it was. On my other machine I tried the same and cannot get the error to go away at all, even after disabling all VS Code extensions. Very strange indeed.

from modular-forms.

fabian-hiller avatar fabian-hiller commented on May 22, 2024

@alexss3 do you have any updates for me? Were you able to solve the problem?

from modular-forms.

ikapo avatar ikapo commented on May 22, 2024

I am also encountering this problem, but on Emacs (using the vscode typescript LSP server though).
skipLibCheck: true is also enabled in my setup

from modular-forms.

fabian-hiller avatar fabian-hiller commented on May 22, 2024

I will look at the problem again. It's just difficult because I can't reproduce it properly.

from modular-forms.

durandj avatar durandj commented on May 22, 2024

I had the same issue and adding "skipDefaultLibCheck": true to my tsconfig.json fixed it for me. 🤷‍♂️

from modular-forms.

fabian-hiller avatar fabian-hiller commented on May 22, 2024

I have made a few changes to the types and tried to solve the problem. Since I still can't reproduce it on my computer, I don't know if the changes were successful. Can you upgrade the library to v.0.8.3 and also upgrade TypeScript and check if it is solved. If TypeScript is installed globally, I also recommend updating the global version.

from modular-forms.

durandj avatar durandj commented on May 22, 2024

I updated to the latest version of Typescript and @modular-forms/solid and have skipLibCheck set to true and skipDefaultLibCheck set to false and the problem still exists.

I'll try and create a repo that reproduces the issue and add it to Github tomorrow.

from modular-forms.

fabian-hiller avatar fabian-hiller commented on May 22, 2024

After some investigation, I suspect that this is a problem that only exists with older TypeScript versions. The editors do not always use the version specified in package.json by default. In VS Code, for example, you can click "{}" in the status bar at the bottom of the screen to select the version. Can you check which version is shown there and if the error messages disappear when you upgrade to TypeScript v4.9.3?

from modular-forms.

durandj avatar durandj commented on May 22, 2024

It's definitely not the Typescript version. It took me a bit to reproduce but I eventually got it with a minimal case.

The problem is if you have @types/node installed then the type of console.log becomes a Blob and that triggers an infinite loop on the ValuePath and ValuePaths types.

You can find my reproduction here: https://github.com/durandj/module-forms-solid-4-repro

The real fix in my case was to replace the onSubmit handler which I had set to console.log for testing with literally anything else lol.

from modular-forms.

fabian-hiller avatar fabian-hiller commented on May 22, 2024

@durandj for me, no error occurs when I clone your repository and install the npm packages.

from modular-forms.

durandj avatar durandj commented on May 22, 2024

from modular-forms.

fabian-hiller avatar fabian-hiller commented on May 22, 2024

You are right, when running pnpm run lint the error occurred. I have found a way to reproduce the problem. When I click on "{}" in the status bar in VS Code, TypeScript v4.8.4 is displayed and no error occurs. If I switch to v4.9.3 I get the error. When I downgrade TypeScript with pnpm i -D [email protected] and then run pnpm run lint the error does not occur.

If it's due to the new TypeScript version, that also explains why the problem has only been occurring for a few days. In this case, I recommend downgrading to v4.8.4 until there is a solution to the problem.

from modular-forms.

fabian-hiller avatar fabian-hiller commented on May 22, 2024

Thank you for your help!

from modular-forms.

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.