Closed lforst closed 1 day ago
@AnthonyRuelle thanks for reporting this. Would you mind providing concrete code examples of what you did with regards to environment variables?
I fear the issue about SSL is out of our control and you need to check your server configuration.
I'm facing an issue where I can't access my environment variables via process.env in my sentry.client.config.ts file. Here are the details:
sentry.client.config.ts File (at the project root):
import { init } from '@sentry/nuxt';
const dsn = process.env.SENTRY_DSN as string;
const release = process.env.RELEASE_BACKOFFICE as string;
const environment = process.env.APP_ENV as string;
console.log('process:', process);
console.log('Sentry DSN:', dsn);
console.log('Sentry release:', release);
console.log('Sentry environment:', environment);
init({
dsn,
release,
environment,
enabled: true,
});
nuxt.config.ts:
export default {
runtimeConfig: {
public: {
APP_ENV: process.env.APP_ENV,
RELEASE_BACKOFFICE: process.env.RELEASE_BACKOFFICE,
SENTRY_DSN: process.env.SENTRY_DSN,
},
},
};
.env File: I have my environment variables properly declared in my .env file.
Problem: Despite having everything set up as above, I cannot access the environment variables via process.env. Additionally, I don’t have access to useRuntimeConfig() in this context, which would have simplified the process.
Well, sentry.client.config.ts
, as the name indicates, runs on the client, where process
is not a thing.
In the next version we release useRuntimeConfig()
will be available in the config file, until then you should be able to pass static values or pass things however you like to there.
Well,
sentry.client.config.ts
, as the name indicates, runs on the client, whereprocess
is not a thing.In the next version we release
useRuntimeConfig()
will be available in the config file, until then you should be able to pass static values or pass things however you like to there.
Version with useRuntimeConfig()
in config file released, probably this issue can be closed.
Originally posted by @AnthonyRuelle in #9095