-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Builds failing in Next13 #104
Comments
I need more info to be able to investigate the problem. Where in the code does the error point to? Is it the |
Hey @fabian-hiller sorry for the late reply here, thought I had it fixed... It seems to be caused inside the useForm hook const [contactForm, { Form, Field }] = useForm<ContactForm>() I can give you access to my repo if you need it. But I'm on the latest Next13 and including my Contact form into a static page inside the App router and then just doing a static build with |
Does that mean that it still doesn't work for you? At the moment I don't have the time to take a closer look. |
Yeah it still doesn't work, and it only doesn't work when building, making this more difficult to debug. I'll see if I can set up a repo later this week to better reproduce this |
I went ahead and tried to debug and it looks like it's not an issue of modular-forms at all but with preact/signals preactjs/signals#297 I'll leave this issue open for now in case others are coming across this if that's ok until it's fixed upstream, although it looks like the issue there is quite stale |
Sorry to ping a third time, but I looked more into it, looks like Preact's signals lib is prone to being broken by updates to React's core APIs due to hacky implementation facebook/react#26704 (comment) @fabian-hiller Are you open to replacing signals as a dependency in modular-forms? |
Is there an alternative to Preact Signals? Or do you mean without Signals at all? |
I don't know of any direct Signals replacement unfortunately. So either using a different and still lightweight state management or doing away with it entirely for the React package. No other state management library will have the same performance as Signals though. It's also possible the Preact team fixes this issue, though unlikely given it's from January and it can affect the library's health long term. |
I leave the issue open temporarily. I don't currently have the time to replace Preact Signals. Modular Forms for React is basically just a copy of the Preact version. Sorry that the library is currently not working for you. |
No worries mate, I appreciate it nonetheless. Hopefully I'll get to use it on a Solidjs project, I like how it works! |
Hi Fabian, just to add to this, I think valtio I also faced the same issue with nextjs. |
Thanks a lot for the tip. As soon as I find time, I will have a look at Valtio. |
Same issue for me, this module can't be used with Next.js |
Sorry, at the moment I can't find the time to fix it. I will note it in the documentation. |
No problem thank you |
Damn, this is sad I am trying to move a project from solidjs SPA to next 13. used modular forms on solidjs thought It would be a smooth transition but this is sad to see. Anyways, please take a look at it only when you have the time no pressure. I really love the library it's a breeze to use on solidjs. Keep up the amazing work! |
Are you using preact react signals maybe try preact core signals that works in next js |
@MariuzM thank you for this hint. Is there any proof of this? Does this then also work with React without Next.js? Then why does the Preact React Signals package exist at all? |
I found this from the comment here: vercel/next.js#45054 Briefly i tried with Preact and usign core worked on my Next For me personally i'm using right now in Next import { useAtom } from 'jotai';
import { atomSignal } from 'jotai-signal';
export const pageLoader = atomSignal(true);
pageLoader.value = false;
const [isLoading] = useAtom(pageLoader);
<div>{isLoading}</div> |
|
really sad that we cannot use this library with nextjs; |
@alzalabany there should be an info in the installation guide. |
I am interested in using this for a new NextJS 14 project. According to this discussion, it looks like (NextJS 14 + @preact/signals-react-2.0.0 + @preact/signals-react-transform) works now. Maybe PR #191 solves this? |
It would be create if you could test it after I merged your PR 🙏 |
Just tried Am I missing something? 😅 |
Thank you! This means I can remove the info about Next.js in our documentation. |
Have you tried bundling your Next.js app with Modular Forms? |
I have not. If you can guide me how I go about doing this, I'll gladly test this for you. |
It's probably the |
Oh, so just building it. Yes, I've done that and it works just fine. |
Thanks for the info! |
Hi there, thanks for your work on this awesome package!
Implemented it in our Next13 project with the new App router and React's RSCs and in local development it works all fine but can't statically build.
We're using the
use client
directive of course in our component that uses the provided hooks.Here' is our form component:
This is the build error:
The text was updated successfully, but these errors were encountered: