Sign in
Log inSign up

Why can't Gatsby read my Contentful environment variables on Netlify?

Samuel Akintunde's photo
Samuel Akintunde
·Oct 15, 2018

So, I'm building my portfolio website and I'm pulling in my projects and blog stories from Contentful. In development, I use a .env file to save the Space ID and Access Token and it works once I use process.env.CONTENTFUL_SPACE_ID and process.env.CONTENTFUL_ACCESS_TOKEN(which is what I saved them as). I use the Build Environment Variables section on Netlify to save the Space ID and Access Token using the same names as in development. However, the build keeps failing with an error, "WebpackError: TypeError: Expected parameter accessToken".

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct