Skip to content
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

Running sentry:publish a 2nd time w/ JS enabled will cause .env to not parse #927

Closed
benvinegar opened this issue Jul 18, 2024 · 0 comments · Fixed by #928 or #930
Closed

Running sentry:publish a 2nd time w/ JS enabled will cause .env to not parse #927

benvinegar opened this issue Jul 18, 2024 · 0 comments · Fixed by #928 or #930
Assignees

Comments

@benvinegar
Copy link

How do you use Sentry?

Sentry SaaS (sentry.io)

SDK version

4.7.1

Laravel version

11.15.0

Steps to reproduce

Run php artisan sentry:publish --dsn=your_dsn once, selecting yes for "Do you want to install one of our JavaScript SDKs? (yes/no)" and choosing a frontend framework (I chose React).

Your .env file will look like this:

SENTRY_LARAVEL_DSN=https://example@example.com/1234567
SENTRY_TRACES_SAMPLE_RATE=1.0
VITE_SENTRY_DSN_PUBLIC="${SENTRY_LARAVEL_DSN}"

Run php artisan sentry:publish --dsn=your_dsn a second time, again selecting yes for JavaScript framework.

Afterwards, try to run any Laravel command (e.g. php artisan serve).

Expected result

It should just work / not cause any exceptions or non-parseable files.

Actual result

The .env file will look like this:

SENTRY_LARAVEL_DSN=https://example@example.com/1234567
SENTRY_TRACES_SAMPLE_RATE=1.0
VITE_SENTRY_DSN_PUBLIC="${SENTRY_LARAVEL_DSN}"
{SENTRY_LARAVEL_DSN}"

Now if you try to run php artisan serve, you will get:

The environment file is invalid!
Failed to parse dotenv file. Encountered an invalid name at [{SENTRY_LARAVEL_DSN}"].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
3 participants