Skip to content

fix(dev): update remark-mdx-frontmatter #10579

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

MichaelDeBoey
Copy link
Member

Fix for GHSA-f7f6-9jq7-3rqj


Closes #10576

CC/ @Evanion

Copy link

changeset-bot bot commented Apr 9, 2025

⚠️ No Changeset found

Latest commit: c002572

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • packages/remix-dev/package.json: Language not supported
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

packages/remix-dev/compiler/plugins/mdx.ts:4

  • Verify that 'remark-mdx-frontmatter' now provides a default export. If the package version does not support default exports, this change may lead to runtime errors.
import remarkMdxFrontmatter from "remark-mdx-frontmatter";

@MichaelDeBoey MichaelDeBoey linked an issue Apr 9, 2025 that may be closed by this pull request
@charIeszhao
Copy link

@brophdawg11 Hi Matt, could you please take a look at this PR and solve the vulnerability issue?

@brophdawg11
Copy link
Contributor

Does anyone know why the tests are failing? Looks to be an ESM/CJS issue

@charIeszhao
Copy link

Does anyone know why the tests are failing? Looks to be an ESM/CJS issue

Seems like remix-run does not support ESM...

@crestwood204
Copy link

crestwood204 commented Apr 18, 2025

To solve the cjs/esm issue, you can use a dynamic import inside the processMDX function and get rid of the import at the top of the file.

let remarkMdxFrontmatter = await import("remark-mdx-frontmatter");

However, trying this with the tests is giving me other mdx specific errors.

Just need to do let remarkMdxFrontmatter = await import("remark-mdx-frontmatter").default;

I created a PR with my changes here: #10589

@MichaelDeBoey MichaelDeBoey force-pushed the update-remark-mdx-frontmatter branch from b29b42c to 651f4bb Compare April 19, 2025 14:14
@crestwood204
Copy link

looks like the integration tests are only failing on msedge. Are those tests flaky? Can you re-trigger them and see if they pass? Would love to get this fix in sooner rather than later since it seems that it can't be solved with an override 🙏

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

Successfully merging this pull request may close these issues.

Vulnerability in transient dependency (CVE-2025-32014)
4 participants