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".
No problem. Anytime
Diego Bernal
Front-End Engineer
I was having similar issues and I got it to work using
dotenv-webpackwith thesystemvars: trueoption.