Skip to content

Conversation

@ctcpip
Copy link
Member

@ctcpip ctcpip commented Oct 17, 2025

transitive dependency ansi-styles is used by different deps so we need to force the older version

@ctcpip ctcpip requested a review from ljharb October 17, 2025 22:37
@ctcpip ctcpip force-pushed the depsdeps branch 2 times, most recently from 498154e to 3ba666e Compare October 17, 2025 22:48
@ljharb
Copy link
Member

ljharb commented Oct 23, 2025

This seems fine, but what is the issue with ansi-styles?

@ctcpip
Copy link
Member Author

ctcpip commented Oct 29, 2025

@ljharb I didn't dig too deeply, but I'm guessing it's due to v6 going ESM-only

@ljharb
Copy link
Member

ljharb commented Nov 8, 2025

As long as we're on node 22+ tho, that shouldn't matter anymore

@ctcpip
Copy link
Member Author

ctcpip commented Nov 11, 2025

$ npm run build

> build
> ./scripts/generate.js

──────────────────────────────────────────────────────────
/Users/chris/githubz/agendas/node_modules/markdown-magic/src/utils/logs.js:72
  const logMsg = `${styles[color].open}${finalPrefix}${msg}${styles[color].close}`
                                  ^

TypeError: Cannot read properties of undefined (reading 'open')
    at log (/Users/chris/githubz/agendas/node_modules/markdown-magic/src/utils/logs.js:72:35)
    at markdownMagic (/Users/chris/githubz/agendas/node_modules/markdown-magic/src/index.js:210:3)
    at Object.<anonymous> (/Users/chris/githubz/agendas/scripts/generate.js:36:1)
    at Module._compile (node:internal/modules/cjs/loader:1706:14)
    at Object..js (node:internal/modules/cjs/loader:1839:10)
    at Module.load (node:internal/modules/cjs/loader:1441:32)
    at Function._load (node:internal/modules/cjs/loader:1263:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)

@ljharb remove the override and give it a whirl?

@ctcpip
Copy link
Member Author

ctcpip commented Nov 12, 2025

@ljharb the fix is that markdown-magic needs to upgrade ansi-styles and then make this change:

- const ansi = require('ansi-styles')
+ const ansi = require('ansi-styles').default

https://github.com/DavidWells/markdown-magic/pull/111

🤷

@ljharb
Copy link
Member

ljharb commented Nov 12, 2025

looks like the author fixed it in v4.0.4?

@ctcpip
Copy link
Member Author

ctcpip commented Nov 12, 2025

@ljharb ugh he decided to inline ansi-styles instead of accepting my patch...

@ctcpip ctcpip force-pushed the depsdeps branch 2 times, most recently from 9622de1 to b72d23a Compare November 12, 2025 14:43
@ljharb ljharb merged commit 4319c8b into main Nov 13, 2025
4 checks passed
@ljharb ljharb deleted the depsdeps branch November 13, 2025 02:06
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.

3 participants