airjp73/rvf

[Bug]: Should add @remix-run/server-runtime

georgiosd opened this issue ยท 10 comments

Which packages are impacted?

  • remix-validated-form
  • @remix-validated-form/with-zod
  • @remix-validated-form/with-yup
  • zod-form-data

What version of these packages are you using?

"remix-validated-form": "^5.0.1"

Please provide a link to a minimal reproduction of the issue.

https://github.com/zerotomvp/remix-ts-integrated-monorepo/tree/yarn3-pnp

Steps to Reproduce the Bug or Issue

remix-run/remix#6640

Expected behavior

Should work because there is a single instance of the package.

Screenshots or Videos

No response

Platform

All

Additional context

Please see remix-run/remix#6640

That sounds reasonable. Would you have time to help with a PR?

Should be fixed in 5.1.2. Could you verify on your end that it's working?

Hi! Sorry, I did mean to send a PR but you got to it first.

I did try upgrading to 5.1.4 and no longer see yarn's warning about the missing peer dependency, alas the project is still not working - check my repo above, I've updated it with 5.1.4.

Not sure if you want to follow up with the remix team...

Yeah, looks like we're getting the "useActionData must be used inside a data router" issue. This is happening because RVF is including a different version of remix than the main app. That's what I was trying to fix with 5.1.4 but the dependencies still aren't resolving correctly.

Screenshot 2023-09-23 at 11 20 20 AM

Since you're using yarn you can probably work around this by forcing remix packages to resolve to a particular version, but I definitely still need to devote some time to debugging this particular issue.

Version 5.1.4-beta.3 seems to be doing the trick. Could you try it out on your end?

I'm afraid no change. I've updated the test repository.

I don't mind helping out, but will probably make it easier for you to validate the fix if you try it directly :)

Thanks for verifying. Unfortunately there are several reproductions posted at this point and i don't have enough free time to go through every one of them and verify it directly. I'll see if I can figure out what's going on in this case.

Oh this is actually the main reproduction I used when debugging ๐Ÿ˜†. On my machine it is currently working -- could you provide more details about what is happening on your end?

  • Did you install the new version in both the remix and shared-ui packages in the monorepo?
  • Could you post exactly what error you're seeing?
  • Could you post the result of npm ls @remix-run/react (maybe yarn ls @remix-run/react if there's an analogous yarn command)?

Are you working in the yarn3-pnp branch on my repo?

I did add to both: zerotomvp/remix-ts-integrated-monorepo@4223c89

The error is Error: Unable to determine form for useField. Please use it inside a ValidatedForm or pass a 'formId'.

I can't remember how I checked this before because we've dropped Remix in the interim but I saw that it was including the (your) package twice.

Output:

~\Documents\remix-ts-integrated-monorepo\remix [yarn3-pnp โ‰ก]> yarn why @remix-run/react 
โ””โ”€ remix@workspace:remix
   โ””โ”€ @remix-run/react@npm:1.17.1 [f6918] (via npm:^1.17.1 [f6918])
~\Documents\remix-ts-integrated-monorepo\remix [yarn3-pnp โ‰ก]> cd ..
~\Documents\remix-ts-integrated-monorepo [yarn3-pnp โ‰ก]> cd .\shared-ui\
~\Documents\remix-ts-integrated-monorepo\shared-ui [yarn3-pnp โ‰ก]> yarn why @remix-run/react
โ””โ”€ remix@workspace:remix
   โ””โ”€ @remix-run/react@npm:1.17.1 [f6918] (via npm:^1.17.1 [f6918])

I tinkered with this for a couple minutes, but no luck. There were multiple extraneous errors caused by missing dependencies in the monorepo itself. And after adding those deps, I'm still not able to get past this error even without using remix-validated-form.

YN0000: โ”Œ Link step
โžค YN0000: โ”‚ ESM support for PnP uses the experimental loader API and is therefore experimental
โžค YN0007: โ”‚ esbuild@npm:0.18.20 must be built because it never has been before or the last one failed
โžค YN0009: โ”‚ esbuild@npm:0.18.20 couldn't be built successfully (exit code 1, logs can be found here: 

I can't remember how I checked this before because we've dropped Remix in the interim but I saw that it was including the (your) package twice.

Since you're unblocked, and we've addressed the original issue, I'm going to close this issue. If you have time to put together a clean reproduction that demonstrates only the issues with RVF, please feel free to open another issue.