Closed martinjinda closed 4 years ago
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 live-form-validation-es6
so you don't have to provide plugin in webpack config. And it works.
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