imranhsayed / frontity-contact-form-7

🔥 Contact Form 7 extension for Frontity theme.
66 stars 12 forks source link

Cannot read property 'inputVals ' of undefined #31

Closed davidrhoderick closed 4 years ago

davidrhoderick commented 4 years ago

When using this package with Frontity 1.9.0 and a WYSIWYG field from ACF Pro, I get the following error:

TypeError: Cannot read property 'inputVals' of undefined
      at eval (webpack-internal:///./node_modules/frontity-contact-form-7/src/index.js:32:79)
      at Object.args [as addHiddenInputs] (webpack-internal:///./node_modules/@frontity/connect/src/create-store.js:5:1702)
      at HiddenInputs (webpack-internal:///./node_modules/frontity-contact-form-7/src/components/HiddenInput.js:15:261)
      at runAsReaction (webpack-internal:///./node_modules/@frontity/connect/src/reactionRunner.js:16:45)
      at reaction (webpack-internal:///./node_modules/@frontity/connect/src/observer.js:7:131)
      at props (webpack-internal:///./node_modules/@frontity/connect/src/connect.js:21:16)
      at processChild (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:397:2319)
      at resolve (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:396:122)
      at ReactDOMServerRenderer.render (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:433:1199)
      at ReactDOMServerRenderer.read (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:433:55)

It was working on one of my machines installed from NPM version 0.1.4 but on another machine, I had to upgrade to get it working without using the deprecated process call.

dejangeorgiev commented 4 years ago

When using this package with Frontity 1.9.0 and a WYSIWYG field from ACF Pro, I get the following error:

TypeError: Cannot read property 'inputVals' of undefined
      at eval (webpack-internal:///./node_modules/frontity-contact-form-7/src/index.js:32:79)
      at Object.args [as addHiddenInputs] (webpack-internal:///./node_modules/@frontity/connect/src/create-store.js:5:1702)
      at HiddenInputs (webpack-internal:///./node_modules/frontity-contact-form-7/src/components/HiddenInput.js:15:261)
      at runAsReaction (webpack-internal:///./node_modules/@frontity/connect/src/reactionRunner.js:16:45)
      at reaction (webpack-internal:///./node_modules/@frontity/connect/src/observer.js:7:131)
      at props (webpack-internal:///./node_modules/@frontity/connect/src/connect.js:21:16)
      at processChild (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:397:2319)
      at resolve (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:396:122)
      at ReactDOMServerRenderer.render (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:433:1199)
      at ReactDOMServerRenderer.read (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:433:55)

It was working on one of my machines installed from NPM version 0.1.4 but on another machine, I had to upgrade to get it working without using the deprecated process call.

Same Issue here.

warudin commented 4 years ago

Same problem here, however I don't have an ACF WYSIWYG field as mentioned in the OP:

TypeError: Cannot read property 'inputVals' of undefined
      at eval (webpack-internal:///./node_modules/frontity-contact-form-7/src/index.js:32:79)
      at Object.eval [as addHiddenInputs] (webpack-internal:///./node_modules/@frontity/connect/src/create-store.js:5:1702)
      at HiddenInputs (webpack-internal:///./node_modules/frontity-contact-form-7/src/components/HiddenInput.js:15:261)
      at runAsReaction (webpack-internal:///./node_modules/@frontity/connect/src/reactionRunner.js:16:45)
      at reaction (webpack-internal:///./node_modules/@frontity/connect/src/observer.js:7:131)
      at eval (webpack-internal:///./node_modules/@frontity/connect/src/connect.js:21:16)
      at processChild (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:397:2319)
      at resolve (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:396:122)
      at ReactDOMServerRenderer.render (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:433:1199)
      at ReactDOMServerRenderer.read (webpack-internal:///./node_modules/react-dom/cjs/react-dom-server.node.development.js:433:55)
anantajitjg commented 4 years ago

I think this error is due to an update in cf7 v5.2. I have submitted a PR #32

dejangeorgiev commented 4 years ago

I think this error is due to an update in cf7 v5.2. I have submitted a PR #32

Great! Thank you @anantajitjg Do you know when it will be available on npm?

anantajitjg commented 4 years ago

Do you know when it will be available on npm?

Sorry! No.

You can install frontity-contact-form-7 package locally(with PR changes) to test if the issue is solved. May be this link will be helpful for you: https://docs.frontity.org/guides/install-a-new-package#local-packages. You can use the package from here for your local package.

Also, you can downgrade the cf7 plugin and test if the issue is solved for now. Hope it helps!

luisherranz commented 4 years ago

Thanks @anantajitjg I have merged the PR. I don't have access to publish the npm package so that has to be done by @imranhsayed.

anantajitjg commented 4 years ago

Thanks @luisherranz for merging the PR. I hope the new version will be released soon by @imranhsayed 🙂 🤞

kilinkis commented 4 years ago

I tried the solution that @anantajitjg said of installing locally, and that fixed it for me :)

warudin commented 4 years ago

For me as well. Hopefully it will be updated on NPM soon.

warudin commented 4 years ago

The update is available on NPM now