Open isaacsultan opened 5 years ago
Taking a closer look at your endpoint... are you sure that's a Mailchimp URL? I'm trying to think what else this could be... did you have this working before and it just failed? Or did you just install this?
I usually recommend removing as much as possible from your environment and slowly adding stuff back in to see if there is a conflict. For example, try using the basic starter from Gatsby with your endpoint, see if you can get that working. If not, that means there is a problem with your endpoint. But if it does work then likely there is a conflict with another plugin.
@isaacsultan and also use the method defined in the docs i.e. addToMailchimp instead of camel case.
The same issue observed in my case, which gets resolved after restarting node (npm start). I was able to add a couple of emails within the last couple of days and then I've run it today and had the same issue:
Uncaught (in promise) ReferenceError: __GATSBY_PLUGIN_MAILCHIMP_ADDRESS__ is not defined at addToMailchimp
which points to this piece of code:
// eslint-disable-next-line no-undef
var endpoint = __GATSBY_PLUGIN_MAILCHIMP_ADDRESS__;
@isaacsultan and also use the method defined in the docs i.e. addToMailchimp instead of camel case.
it's okay, addToMailchimp
has a default export
@benjaminhoffman Mailchimp URL looks correct
Having the same issue. I have also tried passing my MC endpoint URL in as a param to addToMailChimp but the same ReferenceError: GATSBY_PLUGIN_MAILCHIMP_ADDRESS is not defined
is still happening. Endpoint is ok because I send a POST to the same endpoint using Postman and got a 200 back. Could be an issue with conflicting es-lint settings? (shot in the dark, no exp with es-lint)
@nh273 Any luck with this? I'm having the same issue all the sudden.
this is so weird. does anyone here have repro steps i can do? no updates have been made to the plugin so 🤷♂️
this is so weird. does anyone here have repro steps i can do? no updates have been made to the plugin so 🤷♂️
I'm going to try what you suggested and start removing plugins to see if there is a plugin conflict happening, I'll circle back here later today.
I had a silly mistake in my gatsby-config.js
causing this error. Two of my plugins were defined in the same object.. 🤦
plugins: [{
resolve: 'gatsby-plugin-mailchimp',
options: {
endpoint: 'xxxxx',
},
resolve: `gatsby-source-stripe`,
options: {
objects: ['Sku', 'Product'],
secretKey: xxxx,
downloadFiles: true,
},
}]
The Stripe and Mailchimp plugin was defined in the same object causing this issue.
plugins: [{
resolve: 'gatsby-plugin-mailchimp',
options: {
endpoint: 'xxxxx',
},
},
{
resolve: `gatsby-source-stripe`,
options: {
objects: ['Sku', 'Product'],
secretKey: xxxx,
downloadFiles: true,
},
}]
No worries we've all been there, including me 🤦. I have just checked what's happening on my site and I can see it's still working, but it takes a super long time for the state to change and display the message (anyone else have this). Also sometimes get a cors warning in my console. I thought I'd taken care of that through micro-cors package but apparently not.
On Fri, May 1, 2020 at 7:26 PM Sam Ojling notifications@github.com wrote:
I had a silly mistake in my gatsby-config.js causing this error. Two of my plugins were defined in the same object.. 🤦
{ resolve: 'gatsby-plugin-mailchimp', options: { endpoint: 'xxxxx', }, resolve: `gatsby-source-stripe`, options: { objects: ['Sku', 'Product'], secretKey: xxxx, downloadFiles: true, }, },
The Stripe and Mailchimp plugin was defined in the same object causing this issue.
{ resolve: 'gatsby-plugin-mailchimp', options: { endpoint: 'xxxxx', }, resolve: `gatsby-source-stripe`, options: { objects: ['Sku', 'Product'], secretKey: xxxx, downloadFiles: true, }, },
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/benjaminhoffman/gatsby-plugin-mailchimp/issues/42#issuecomment-622504999, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCIF5RJHEMTBVRZZ5ONCQDRPMH43ANCNFSM4IEQLGEA .
I had the same problem but I only had to restart the gatsby server and it worked again
Looks like this may be solved? Would love to close it but if anyone is still experiencing issues, I am happy to keep it open.
I have the same issue, when I try to import Mailchimp, I have this error,
"Could not find a declaration file for module 'gatsby-plugin-mailchimp'. 'implicitly has an 'any' type.
Try npm install @types/gatsby-plugin-mailchimp
if it exists or add a new declaration (.d.ts) file containing declare module 'gatsby-plugin-mailchimp';
ts(7016)"
my gatsby verson is 2.24.2, how can I get pass this error.
I'm facing the same issue ,it keep saying https is not defined. Even after restart and installing npm install gatsby-plugin-mailchimp, i'm receiving the same message.
I had this issue and it was down to the formatting of my gatsby-config.js
.
Weirdly, the previous plugin in the file didn't have a comma after a }
. It was the last {
in the list but putting the comma in made the the Mailchimp plugin suddenly start seeing the configured endpoint
.
System details
Usage
The endpoint is defined in
gatsby-config.js
as:And called:
Stacktrace