-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop NODE_ENV=development
when building
#68
Comments
@tmeasday seems in CI when chromatic is running, it doesn't include env vars. so my storybook is busted until I can figure out how to overcome this. (using next.js) in preview.js import { setConfig } from 'next/config';
setConfig({
publicRuntimeConfig: {
API_HOST: process.env.API_HOST,
GOOGLE_MAPS_API_KEY: process.env.GOOGLE_MAPS_API_KEY,
},
}); apparently API_HOST and GOOGLE_MAPS_API_KEY are undefined when chromatic runs in CI |
@lifeiscontent are the env vars used in the frontend (ie inside the browser)? This seems like a storybook issue perhaps, we don't drop any env vars we just add a couple: https://github.com/chromaui/chromatic-cli/blob/master/bin/storybook/start-app.js#L60:L64 You'd need to ensure you webpack config for built storybooks passes env vars through to the browser, using something like |
@tmeasday thanks for the response! We’re using next.js so in the storybook config I’m using setConfig from “next/config” and setting the env vars we need from process.env. I’m also using a custom web pack config for storybook to step over some of the issues with next.js e.g. Babel configs |
also, fwiw, everything works as expected in development. |
Does it work when you run |
@tmeasday great question, let me try it! |
@tmeasday yep, it builds, should I try and run it with serve? |
@tmeasday I just ran it with serve, everything works fine. |
You don't get any errors to the console? |
@tmeasday None! |
@tmeasday pinged you on Intercom |
This is a historical accident. I'm not sure if it is a breaking change or not.
The text was updated successfully, but these errors were encountered: