-
Notifications
You must be signed in to change notification settings - Fork 48
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
<IntlProvider> leads to crash in production build #212
Comments
I can't reproduce this issue. Could you provide a minimal reproduction, e.g. some code, that you used to trigger this? |
@jonas-jonas I was able to reproduce the bug within a default next.js project. Here is a proof of concept: https://github.com/janoschp/ory-elements-bug-proof-of-concept . Run |
You can also try replacing the |
@jonas-jonas could you reproduce the bug with my code? |
I faced same issue. |
I was able to reproduce the issue with your example @janoschp, thank you for submitting this. For now I do not have a clear solution for this bug, I'll be checking few other options and will let you know if it's fixed. It seems like bundling the library itself is a problem. |
Any progress on this? |
We are very close to releasing Ory Elements 1.0 for ReactJS, where this will no longer be an issue. It also works with NextJS page and app router, and a lot more. |
I looked into this issue, and agree with @mszekiel that it is probably something with the bundling process? For some reason, the argument passwed to react-intl is an object and not a function, which may happen if we target for the wrong bundle? I'm not sure. I've suuplied a PR to upgrade react-intl, in the hopes that it will just solve the issue, but I wouldn't bet on it ;) |
Can someone in this thread please check if upgrading react-intl helps? |
Any update on this? I confirm the solution @janoschp mentioned works: replacing |
Preflight checklist
Ory Network Project
jolly-antonelli-gs7stzrg5w
Describe the bug
Using your
<IntlProvider>
component works well in a dev build but not in an optimized production build. The error I keep getting is this:When I use the
<IntlProvider>
from 'react-intl' then there is no problem, but I no longer have the option to override ory error messages, which I now have to do.Reproducing the bug
Setup a nextjs project, use any ory element that is wrapped in a
<IntlProvider>
from '@ory/elements' component. Create a production build likenext build
and runnext start
. Open the website with the ory element on it -> client-side crash.Relevant log output
Failed to load resource: the server responded with a status of 401 (Unauthorized) 8041-ac529177d55d32fd.js:19 TypeError: (intermediate value)(intermediate value)(intermediate value) is not a function at memoize (ceb6948a-f5b67890939b9aa6.js:5:62014) at createFormatters (ceb6948a-f5b67890939b9aa6.js:16:1330) at createIntl$1 (ceb6948a-f5b67890939b9aa6.js:26:119) at createIntl (ceb6948a-f5b67890939b9aa6.js:26:4026) at new t (ceb6948a-f5b67890939b9aa6.js:26:4634) at lC (fd9d1056-92f9772659382b4a.js:1:55121) at lW (fd9d1056-92f9772659382b4a.js:1:60010) at iZ (fd9d1056-92f9772659382b4a.js:1:118352) at ia (fd9d1056-92f9772659382b4a.js:1:95507) at fd9d1056-92f9772659382b4a.js:1:95329 at il (fd9d1056-92f9772659382b4a.js:1:95336) at oJ (fd9d1056-92f9772659382b4a.js:1:92692) at nb (fd9d1056-92f9772659382b4a.js:1:27178) at nw (fd9d1056-92f9772659382b4a.js:1:27916) at fd9d1056-92f9772659382b4a.js:1:28950 (anonymous) @ 8041-ac529177d55d32fd.js:19
Relevant configuration
No response
Version
On which operating system are you observing this issue?
Ory Network
In which environment are you deploying?
Ory Network
Additional Context
No response
The text was updated successfully, but these errors were encountered: