surveyjs / custom-widgets

The collection of custom widgets for SurveyJS: Survey Library and Survey Creator :package:
https://surveyjs.io
MIT License
79 stars 78 forks source link

Error in ReactJS v16, Webpack v3.5 #60

Closed bschellekens closed 5 years ago

bschellekens commented 6 years ago

Hi there!

I'm integrating the SurveyWidgets in an existing project, build with the latest reactJS starter app and I think I'm running into a webpack dependancy issue. Anyone already running SurveyJS-Widgets under the latest ReactJS?

The error that I'm getting is: TypeError: __WEBPACK_IMPORTED_MODULE_0_signature_pad___default.a is not a constructor

Found in the core node_modules of surveyjs-widgets, node_modules/surveyjs-widgets/surveyjs-widgets.js:989: 989 | var signaturePad = new __WEBPACK_IMPORTED_MODULE_0_signature_pad___default.a(canvas);

I've compared the package.json with the starter kit and the last ReactJS starter kit, and saw that the difference were particularly in Webpack. However, downgrading Webpack to v1 does not work with the last React required in the particular project.

Any thoughts? Many thanks :)

tsv2013 commented 6 years ago

Have you checked this repo - https://github.com/surveyjs/surveyjs_react_quickstart? It demonstrates SignuturePad and works ok for me.

bschellekens commented 6 years ago

Yes, saw the project but that was build in a previous ReactJS version with webpack 1.14. It seems that updating this to webpack 3 generates the issue as well. What's your experience there?

dmitry-kurmanov commented 6 years ago

@bschellekens we will check it.

bschellekens commented 6 years ago

Cool! Is there something I can do to assist?

dmitry-kurmanov commented 6 years ago

@bschellekens hello! I've updated https://github.com/surveyjs/surveyjs_react_quickstart repo with latest "create-react-app" and it looks ok for me. Could you check it please?

sumitlearnt commented 5 years ago

This is issue is still not solved , worked for older webpack version

dk981234 commented 5 years ago

Hello, I think it's conflict between react-scripts and webpack. We adding react-scripts as dependency and it installs required version of webpack. Thanks Dmitry SurveyJS Team

sumitlearnt commented 5 years ago

So, what is the solution for this?

dk981234 commented 5 years ago

Hello, You can delete your webpack from package.json and from node_modules in working directory. Here is issue on create-react-app github. Thanks Dmitry SurveyJS Team