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

#62 Replace require() with import() to comply with doctoc package change #64

Closed
wants to merge 1 commit into from

Conversation

ehellman
Copy link

This should contribute to fixing #62

Seems like more things needs to happen though, because performing this change locally allowed me to build the README file but also came with new errors:

The auto-generating of rules finished!
(node:15640) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '.'
    at Loader.moduleStrategy (internal/modules/esm/translators.js:140:18)
    at async link (internal/modules/esm/module_job.js:42:21)
(node:15640) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15640) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Since I am not familiar with the codebase of this package I could use some help here.

@ljharb
Copy link

ljharb commented Aug 17, 2022

That’s definitely not sufficient - the entire package here would have to be refactored to be async. There’s not really a solution in this package short of pinning doctoc to a non broken version (~2.4)

@ehellman
Copy link
Author

That’s definitely not sufficient - the entire package here would have to be refactored to be async. There’s not really a solution in this package short of pinning doctoc to a non broken version (~2.4)

I suspected as much, damn it!

So a new version that pins doctoc to a non-broken version has to be released until things can start working again locally? Resolutions doesn't seem to solve this issue in a local project.

@ljharb
Copy link

ljharb commented Aug 18, 2022

Either that, or, doctoc has to unbreak itself. The former is almost certainly more expedient.

The way I've solved it in the meantime is by explicitly depending on ~2.4 of doctoc, no resolutions/overrides required.

@DavidWells
Copy link
Owner

Locked the dep to older version here #65

Released via markdown-magic@2.6.1

Thanks for the report

@DavidWells DavidWells closed this Sep 2, 2022
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.

None yet

3 participants