Comments (4)
could you check if it's a valid cloud name? You can just use a sample Cloudinary image URL on your browser. Also, print the .env data in development anywhere to see if the value is passed. Let me know if all these are positive while I try to reproduce it.
from gatsby-source-cloudinary.
I think I figured out where the problem is. It seems to be related to the gatsby-config.js. In the plugin documentation it recommends placing the cloudinary api config in a .env.development file, and then in gatsby-config.js:
// Load the environment variables.
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
});
but if I run the gatsby build command the node env is no longer looking for development. Renaming .env.development to .env, and removing the NODE_ENV specificity prevents the error during gatsby build:
require('dotenv').config({
path: `.env`,
});
But I'm not sure if this is an ideal solution, if a user wants to specify different .env variables at build and develop stages. Is there a better way to solve for this?
from gatsby-source-cloudinary.
Yes, that's the solution. Typically you may want to maintain different .env definitions for your environments. If it's the same .env config across dev and production then you can just use .env
instead of .env.development
or .env.production
.
You can add a .env.development
file too with the dev variables if you like.
Also, to specify different ENV then you can add the NODE_ENV config in your scripts object in package.json. Something like
"build": "NODE_ENV=production gatsby build"
Replace the NODE_ENV value for the dev command.
from gatsby-source-cloudinary.
Ah ok great thanks for the suggestion!
from gatsby-source-cloudinary.
Related Issues (20)
- Question on use with blogs HOT 1
- The gatsby-source-cloudinary plugin has generated no Gatsby nodes. Do you need it? HOT 2
- Source from Cloudinary and process with gatsby-transformer-sharp? HOT 3
- Question: How do I query two or 3 images instead of just all or one. HOT 2
- Are tags and key:values accessible from the GraphQL database? HOT 1
- A typo in Installation section
- Support for Gatsby-plugin-image HOT 4
- Add demo site + move to yarn workspace HOT 1
- Add automated test and release process using Semantic Release HOT 1
- Validate configured options using `pluginOptionsSchema` HOT 2
- Add CONTRIBUTING.md HOT 1
- Rework README.md HOT 1
- Link from README.md to CONTRIBUTING.md HOT 1
- Clarify usage for multiple `resourceType`s HOT 3
- Add custom analytics code for generated Cloudinary URLs HOT 1
- Cannot find module '../package.json' HOT 3
- Can't build due to incorrect path to package.json HOT 2
- Make the Contributing.md hacktoberfest ready HOT 3
- Be able to pass in a custom cname into the config
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-source-cloudinary.