-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Invisible recaptcha + webpack + live form #28
Comments
Hi. Unfortunately I don't know. Maybe others. |
Hi, I'll look at it this week ;) |
Hello, any news on this issue? I'm getting the same error. Same Nette and ReCaptcha version, PHP 7.1 |
I investigated, Have you added https://nette.github.io/resources/js/3/netteForms.min.js too ? ping @martinjinda @spulakk |
Problem is that it create anonym function so invisibleRecaptcha dont know about this var. I tried add window.Nette = require('live-form-validation');
window.Nette.initOnLoad(); into invisibleRecaptcha.js and it works. |
I tried adding the snippet at the start of invisibleRecaptcha.js and it didn't change anything for me. Also I was fairly time constrained so I went with my own implementation of ReCaptcha already. Thanks for trying though, hopefully it helps @martinjinda at least. |
@spulakk ok :) Problem solved with configuration webpack ebpack.config.js: const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'www'),
},
plugins: [
new webpack.ProvidePlugin({
Nette: 'live-form-validation'
}),
],
}; of course remove require of live-form-validation my index.js Nette.initOnLoad();
import './invisibleRecaptcha' documentation: https://webpack.js.org/guides/shimming/#shimming-globals |
Thanks @JanGalek. It's great, we start using |
Hello guys, we want to use invisible reCaptcha, since the regular one is working perfectly. But we got following error from the compiled js script
Nette is not defined
.If I use the script the included directly in main.js with
window.Nette
or$.nette
the form is sent but we don't get any response from Nette. We also have the form included in the snippet (#12).main.js compiled with webpack
We have (but I tested with Nette 3.0 + reCaptcha 3.2 and it was the same problem).
Has anyone run into the same problem? Thank you
The text was updated successfully, but these errors were encountered: