mgp25
mgp25
WWasp-lang
Created by mgp25 on 11/21/2024 in #đŸ™‹questions
Question about shared constants
We have the following code in shared constants:
const isDevEnv = process.env.NODE_ENV !== 'production';
const customerPortalTestUrl = 'TEST_URL';
const customerPortalProdUrl = 'PROD_URL';

export const STRIPE_CUSTOMER_PORTAL_LINK = isDevEnv
? customerPortalTestUrl
: customerPortalProdUrl;
const isDevEnv = process.env.NODE_ENV !== 'production';
const customerPortalTestUrl = 'TEST_URL';
const customerPortalProdUrl = 'PROD_URL';

export const STRIPE_CUSTOMER_PORTAL_LINK = isDevEnv
? customerPortalTestUrl
: customerPortalProdUrl;
When testing locally, I am seeing the file constants is fetched as it is, being able to see test url as well. Is this the expected behaviour? Is there any better way to be able to set these while keeping the test url hidden during the deploy?
8 replies
WWasp-lang
Created by mgp25 on 6/4/2024 in #đŸ™‹questions
Can't find variable: process
I am lately getting ReferenceError: Can't find variable: process which is caused by /server/config.ts and points to:
all: {
env,
isDevelopment: env === 'development',
port: parseInt(process.env.PORT) || 3001,
databaseUrl: process.env.DATABASE_URL,
allowedCORSOrigins: [],
auth: {
jwtSecret: undefined
}
},
all: {
env,
isDevelopment: env === 'development',
port: parseInt(process.env.PORT) || 3001,
databaseUrl: process.env.DATABASE_URL,
allowedCORSOrigins: [],
auth: {
jwtSecret: undefined
}
},
As far as I know, this should be only run in the server and not the client and therefore causing the error. I have not changed anything within the Wasp Project. No matter what I do, once I run wasp start the project only shows a blank page with that error in the web console. Any idea what could happen? OS: MacOS Node version: 18.20.3 Wasp version: 0.13.2
4 replies