Skip to content
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

ReferenceError when fast-form-generator-react is uglified through create-react-app #789

Closed
brandonthomas opened this issue Aug 15, 2018 · 3 comments
Assignees
Labels
bug A bug warning:stale No recent activity within a reasonable amount of time

Comments

@brandonthomas
Copy link

Describe the bug
When fast-form-generator-react is put through a production build using the default setup of create-react-app there appears to be an error when uglification scopes functions. This results in a ref error due to a value being undefined (or so it thinks). Below is the error although it's pretty useless.

ReferenceError: s is not defined
at t.t (form-section.utilities.js:226)
at new (form-section.js:62)
at Ni (react-dom.production.min.js:174)
at ha (react-dom.production.min.js:202)
at ma (react-dom.production.min.js:203)
at $a (react-dom.production.min.js:212)
at qa (react-dom.production.min.js:211)
at Ga (react-dom.production.min.js:211)
at rs (react-dom.production.min.js:223)
at Nn (react-dom.production.min.js:89)
zi @ react-dom.production.min.js:188
n.callback @ react-dom.production.min.js:195
Ko @ react-dom.production.min.js:144
Go @ react-dom.production.min.js:145
Xa @ react-dom.production.min.js:220
$a @ react-dom.production.min.js:212
qa @ react-dom.production.min.js:211
Ga @ react-dom.production.min.js:211
rs @ react-dom.production.min.js:223
Nn @ react-dom.production.min.js:89
form-section.utilities.js:226 Uncaught ReferenceError: s is not defined
at t.t (form-section.utilities.js:226)
at new (form-section.js:62)
at Ni (react-dom.production.min.js:174)
at ha (react-dom.production.min.js:202)
at ma (react-dom.production.min.js:203)
at $a (react-dom.production.min.js:212)
at qa (react-dom.production.min.js:211)
at Ga (react-dom.production.min.js:211)
at rs (react-dom.production.min.js:223)
at Nn (react-dom.production.min.js:89)

To Reproduce
Steps to reproduce the behavior:

  1. Create an app using create-react-app (i used the typescript version)
  2. Include a Form in your app
  3. Ensure that your schema has oneOf or anyOf defined
  4. Run a production build
  5. Run your app and you should see it puke

Expected behavior
Prod build works with create-react-app

Additional context
Here are some threads around a similar issue that another package ran into
mapbox/mapbox-gl-js#4359 (comment)
mapbox/mapbox-gl-js#6956

@triage-new-issues triage-new-issues bot added the status:triage New Issue - needs triage label Aug 15, 2018
@brandonthomas
Copy link
Author

I could fix this by ejecting create-react-app and making changes to my webpack.config.js (namely ensuring that sourceMap: true instead of shouldUseSourceMap) but I think create-react-app is common enough that this package should support it out of the box. Not to mention this is a tricky issue to debug.

@nicholasrice nicholasrice added the bug A bug label Aug 15, 2018
@triage-new-issues triage-new-issues bot removed the status:triage New Issue - needs triage label Aug 15, 2018
@nicholasrice nicholasrice self-assigned this Sep 6, 2018
@stale
Copy link

stale bot commented Dec 5, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the warning:stale No recent activity within a reasonable amount of time label Dec 5, 2018
@stale stale bot closed this as completed Dec 15, 2018
@brandonthomas
Copy link
Author

@nicholasrice, did you guys solve this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug warning:stale No recent activity within a reasonable amount of time
Projects
None yet
Development

No branches or pull requests

2 participants