Skip to content

Conversation

priscilawebdev
Copy link
Member

Problem

If a Remix project doesn't yet have a routes folder, as was the case when I followed only the initial steps of this tutorial, running the Sentry wizard and answering 'yes' to create a Sentry example fails to generate the example, and no feedback is provided.

Solution

Update the code to check whether the routes folder exists. If it doesn’t, create the folder to allow the Sentry example to be successfully generated.

Note
Users will still need to complete this step to fully view the Sentry example. However, since the route will be created, users will at least see some feedback in the project - the new file.

closes getsentry/sentry#78331

@priscilawebdev priscilawebdev requested review from a team and lforst September 30, 2024 15:06
Copy link
Member

@shellmayr shellmayr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@priscilawebdev priscilawebdev merged commit af676b0 into master Oct 1, 2024
13 checks passed
@priscilawebdev priscilawebdev deleted the priscila/fix/remix/creation-sentry-example-page branch October 1, 2024 07:21
const routesPath = 'app/routes';

if (!fs.existsSync(routesPath)) {
fs.mkdirSync(routesPath);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may fail, when there is no /app folder. We probably want to do fs.mkdirSync(routesPath, { recursive: true }).

Copy link
Member Author

@priscilawebdev priscilawebdev Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great feedback @lforst . I updated the code in the PR #681

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it fails to create the file if the app folder doesn't exist. It's part of the default Remix setup, so it's unlikely to be missing, but adding recursive: true was a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Remix]: The wizard doesn't generate an example page when we select 'yes'.

3 participants