-
Notifications
You must be signed in to change notification settings - Fork 94
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
Formjs Viewer: Error in production build - onSubmit and onChange #240
Comments
Example repo -> https://github.com/2manoj1/bpnmformjs
|
Hi, Thanks for reporting this issue. It seems that the build tool (Terser) used by Next.js transforms the Validator to a function below:
Then, the didi dependency injection kicks in and tries to provide the cryptic "e" module which does not exist. I don't quite get it why the class is transformed this way, but can see a potential solution to the issue. We could try out if adding a line below fixes the problem: Validator.$inject = [] We are happy to accept external contributions so if you want to provide a PR, you are welcome to do so. |
Hi @barmac, I dont much idea and knowledge on form-js lib. Can you give some workaround or quick fix for production issue. |
I think you could try to play with the configuration, but can't give you a ready-to-use solution as I lack knowledge on Next.js. Check out this: https://stackoverflow.com/questions/42300147/how-to-disable-in-webpack-to-rename-of-function-names-typescript-javascript |
Latest nextjs does nott use Terser. swcMinify by default. https://nextjs.org/docs/upgrading#swc-replacing-terser-for-minification. Tried swcMinify: false but no luck of work. |
Its added to swc known issue. swc-project/swc#2934 |
Not sure if this is an issue of swc, considering that it fails even with |
The solution to the issue is in #240 (comment) It's not an swc issue but a problem with how dependency injection form-js works. |
@barmac When this fix available so I will test? |
@barmac not able test this. Its showing close issue but not get any releases. |
Indeed, this will be possible when we release the library. This should happen rather soon. |
Happening pretty soon: #243 |
@manoj-mukherjee-maersk Please verify it's fixed with v0.7.1 |
Its fixed. Thank you 😊. |
Describe the Bug
Getting below error on running the project in production build. It's working fine in dev build.
Uncaught Error: No provider for "e"! (Resolving: validator -> e)
Steps to Reproduce
yarn create next-app --typescript
yarn add @bpmn-io/form-js
Expected Behavior
In production build no error and onSubmit should work.
Environment
The text was updated successfully, but these errors were encountered: