Git Product home page Git Product logo

Comments (10)

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

Does the problem exist when you downgrade to Qwik v1.1.5? Qwik v1.2.X is currently causing problems in general: BuilderIO/qwik#4789

from modular-forms.

devcaeg avatar devcaeg commented on May 23, 2024

Does the problem exist when you downgrade to Qwik v1.1.5? Qwik v1.2.X is currently causing problems in general: BuilderIO/qwik#4789

I have made a modification to the 'index.qwik.mjs' file, specifically to the 'formActionQrl' function. This change involves altering the 'trycatch' block, in such a way that the catch always sets the 'formActionStore' variable, which eliminates the error. I acknowledge that this is not the optimal solution, but it is a provisional measure to avoid delays in the development.

The problem that arises now is that, even though no errors are now presented and the 'formActionStore' variable is properly set with the error messages, etc., the errors are never displayed in the form 'input' and the 'response' is also not set.

I am including an image of the modified function, highlighting the change made.

code

from modular-forms.

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

Can you check if the problem still occurs in v0.20.0?

from modular-forms.

devcaeg avatar devcaeg commented on May 23, 2024

Can you check if the problem still occurs in v0.20.0?

Hello, excuse my absence.

In the latest version of QwikJS and ModularForms, the same error continues to occur.

from modular-forms.

devcaeg avatar devcaeg commented on May 23, 2024

I would like to know if there is anything I can do to help solve this problem.

from modular-forms.

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

Maybe this is the problem: vitejs/vite#9528

Does the problem still occur when you run your Qwik application via pnpm preview?

from modular-forms.

devcaeg avatar devcaeg commented on May 23, 2024

Maybe this is the problem: vitejs/vite#9528

Does the problem still occur when you run your Qwik application via pnpm preview?

Hello, yes, in preview mode the error also occurs.

ws [FormError]
    at M2 (file:///Users/caeg.dev/Desktop/duenodirecto/workspace/frontend/server/entry.preview.mjs:294:98288)
    at $e (file:///Users/caeg.dev/Desktop/duenodirecto/workspace/frontend/server/entry.preview.mjs:25:5237)
    at file:///Users/caeg.dev/Desktop/duenodirecto/workspace/frontend/server/entry.preview.mjs:30:2751
    at J (file:///Users/caeg.dev/Desktop/duenodirecto/workspace/frontend/server/entry.preview.mjs:24:1509)
    at file:///Users/caeg.dev/Desktop/duenodirecto/workspace/frontend/server/entry.preview.mjs:30:2618
    at g (file:///Users/caeg.dev/Desktop/duenodirecto/workspace/frontend/server/entry.preview.mjs:30:2878)
    at Object.f2 (file:///Users/caeg.dev/Desktop/duenodirecto/workspace/frontend/server/entry.preview.mjs:294:92884)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.g (file:///Users/caeg.dev/Desktop/duenodirecto/workspace/frontend/server/entry.preview.mjs:30:2855)
    at async file:///Users/caeg.dev/Desktop/duenodirecto/workspace/frontend/server/entry.preview.mjs:16:533 {
  errors: { mobilePhoneNumber: 'Test error.' }
}

from modular-forms.

devcaeg avatar devcaeg commented on May 23, 2024

For what it's worth, this is my "formAction$" that I use to test the error.

export const useAction = formAction$<Register>(() => {
  throw new FormError<Register>({
    mobilePhoneNumber: 'Test error.',
  });
}, zodForm$(register));

from modular-forms.

devcaeg avatar devcaeg commented on May 23, 2024

I just realized that if instead of doing a "throw" you do a "return" the error disappears and everything seems to work correctly.

I used "throw" because the documentation says so.

export const useAction = formAction$<Register>(() => {
  return new FormError<Register>({
    mobilePhoneNumber: 'Test error.',
  });
}, zodForm$(register));

from modular-forms.

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

This is strange. Since formAction$ uses try/catch, throw should work. I will check this as soon as I find time.

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.