Giter Club home page Giter Club logo

Comments (14)

adsoink avatar adsoink commented on May 31, 2024

Update: Did some additional testing and found that the error above only occurs when the credentials are placed in a .env file. How can this be fixed? My initial input is exactly what appears in your documentation, but it again produces the "split" error.

It also looks like "basic auth" will create a 401 error. Eliminating it from the config and leaning wholly on the v2 credentials gives access when the v2 credentials are passed directly from the config and not .env.

from gatsby-source-gravityforms.

robmarshall avatar robmarshall commented on May 31, 2024

Hey,

Nice one for letting me know!

Are you able to provide:

  • The line the error is on
  • The full error message
  • The version of GSG you are using
  • Your config setup

And if none of that helps, would you be happy giving me access to your build to run on my machine?

At a first glance I am guessing your URL is set up differently to mine. Is your baseUrl containing http/https.

e.g.

{
resolve: "gatsby-source-gravityforms",
      options: {
        // Base URL needs to include protocol (http/https)
        baseUrl: "https://gatsbytestsite.com",
        // Gravity Forms API
        api: {
          key: "",
          secret: "",
        },
      },
    }

Cheers,
Rob

from gatsby-source-gravityforms.

adsoink avatar adsoink commented on May 31, 2024

Hey Rob,

It looks like the “split” error occurs at [gsg]/utils/basicAuthToURL.js 4:22 and [gsg]/gatsby-node.js 46:60. This happens when the credentials are added to .env, and removing "basicAuth" gives the same result. I've attached a screenshot of the output.

The version of GSG I'm using is from the repository, and I nabbed it via NPM (1.0.12). What portion of the config are you needing to see?

As for the basicAuth error, it's a straight 401 response.

My base url contains HTTPS, so we're good there. I can connect if I remove basicAuth and input the credentials directly in the config file.

-Travis

Screen Shot 2019-08-03 at 1 31 20 AM

from gatsby-source-gravityforms.

robmarshall avatar robmarshall commented on May 31, 2024

If I can see your config for the plugin. Nothing else. What I posted above but your version.

Cheers

from gatsby-source-gravityforms.

adsoink avatar adsoink commented on May 31, 2024

It's this -

{
resolve: gatsby-source-gravityforms,
options: {
baseUrl: process.env.SOURCE_URL,
api: {
key: process.env.GF_CONSUMER_KEY,
secret: process.env.GF_CONSUMER_SECRET,
},
//basicAuth: {
// username: process.env.AUTH_USERNAME,
// password: process.env.AUTH_PASSWORD,
//},
},
},

from gatsby-source-gravityforms.

robmarshall avatar robmarshall commented on May 31, 2024

Is your domain secret? If not, could you include the exact URL that you are including in the config.

from gatsby-source-gravityforms.

adsoink avatar adsoink commented on May 31, 2024

Code insert for some reason isn't working on my end. The plugin name is in quotes in my file.

from gatsby-source-gravityforms.

robmarshall avatar robmarshall commented on May 31, 2024

try
<'pre><'code>xxx</'pre></c'ode>
next time

without the commas. I needed that to get it to show ;)

from gatsby-source-gravityforms.

adsoink avatar adsoink commented on May 31, 2024

The domain isn't secret. It's https://adsoink.com. It's my website that I use from time to time as a testing ground.

from gatsby-source-gravityforms.

robmarshall avatar robmarshall commented on May 31, 2024

Would you be happy to message me your .env.dev file? So I can see if that is an issue?
As well as access to your repo.

I am struggling to see the issue atm.

from gatsby-source-gravityforms.

adsoink avatar adsoink commented on May 31, 2024

There frankly isn't much to look at. It's three lines.

<pre><code>SITE_BASE_URL = 'https://adsoink.com' GF_CONSUMER_KEY = 'key' GF_CONSUMER_SECRET = 'secret'</code></pre>

from gatsby-source-gravityforms.

robmarshall avatar robmarshall commented on May 31, 2024

Try unwrapping your sitename, so it is just SITE_BASE_URL=https://adsoink.com

If that doesnt work, try console logging your variable out in gatsby-node.js and see if it shows, or is undefined.

I have had issues in the past where gatsby isnt reading the env file.

from gatsby-source-gravityforms.

adsoink avatar adsoink commented on May 31, 2024

I've tried unwrapping the URL and see the same result, sadly. Tried back ticks as well.

The file is being read, and the variable is defined which is what makes this error weird. I've also deleted and reinstalled the plugin a couple of times via npm and yarn just in case it was an issue with the install.

To be honest, this is only going to be live for a couple of hours next week as a proof of concept. Everything seems to work just fine without the basicAuth, and I don't envision needing a fallback immediately.

I'll continue working with this through the weekend, and let you know if I run into the issue again.

Thanks for your time today!

from gatsby-source-gravityforms.

robmarshall avatar robmarshall commented on May 31, 2024

No worries.

I just rolled out a new version to NPM with a little bit of added error checking. It will probably not help you, but still stop the smaller mistakes. Also outputs a little bit more insight into what is happening.

Let me know what you find, so I can update/add logging where needed.

Cheers

from gatsby-source-gravityforms.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.