aurelia-plugins / aurelia-plugins-google-recaptcha

A Google Recaptcha plugin for Aurelia.
MIT License
5 stars 6 forks source link

The plugin is not bundled and application makes GET call to server to fetch the .js file of the plugin #6

Closed chintanb closed 7 years ago

chintanb commented 7 years ago

So I am following the instructions, given on the page.

The problem I am having is, when I run npm install for the plugin and add babel in my aurelia.json, put the necessary code in and load the application it tries to load the plugin making a separate ajax call to http://localhost:9000/src/aurelia-plugins-google-recaptcha.js

And then if I install the plugin using "au install aurelia-plugins-google-recaptcha", it works fine but it still makes a GET call to "http://localhost:9000/node_modules/aurelia-plugins-google-recaptcha/dist/amd/aurelia-plugins-google-recaptcha-element.js" The above is fine while I am running Aurelia locally in dev mode but when I run it on the server, I get 401 as this API call is not supported and is secured. Any idea on what's wrong with the way I am using this plugin with Aurelia CLI ?

bartlenaerts commented 7 years ago

Hi,

I've made a fix to the package.json file so Aurelia CLI will include the plugin correctly. Please try the new version.

If you get a regenerator error than also add node_modules/babel-polyfill/dist/polyfill.min.js to the prepend list in aurelia.json. Do not forgot to add babel-polyfill to the dependencies in package.json.

Greetz, Bart