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

fix: cannot find installed markdown-it plugin by yarn v3 monorepo #199

Merged
merged 4 commits into from
May 27, 2023

Conversation

dimaslanjaka
Copy link
Contributor

@dimaslanjaka dimaslanjaka commented May 22, 2023

fixed cannot find some markdown-it plugin which installed by yarn berry.

error logs before fixed:

ERROR Plugin load failed: hexo-renderers
Error: Cannot find module 'markdown-it-table-of-contents'
Require stack:
- D:\Repositories\hexo-renderers\lib\dist\markdown-it\renderer.js
- D:\Repositories\hexo-renderers\lib\dist\renderer-markdown-it.js
- D:\Repositories\hexo-renderers\lib\dist\renderer-loader.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
    at Function.Module._load (internal/modules/cjs/loader.js:774:27)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at require (internal/modules/cjs/helpers.js:107:18)
    at D:\Repositories\hexo-renderers\lib\dist\markdown-it\renderer.js:38:39
    at Array.reduce (<anonymous>)
    at new Renderer (D:\Repositories\hexo-renderers\lib\dist\markdown-it\renderer.js:33:35)       
    at rendererMarkdownIt (D:\Repositories\hexo-renderers\lib\dist\renderer-markdown-it.js:103:20)    at D:\Repositories\hexo-renderers\lib\dist\renderer-loader.js:56:9
    at D:\Repositories\hexo-renderers\test\node_modules\hexo\dist\hexo\index.js:272:20
    at tryCatcher (D:\Repositories\hexo-renderers\test\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\Repositories\hexo-renderers\test\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (D:\Repositories\hexo-renderers\test\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromise0 (D:\Repositories\hexo-renderers\test\node_modules\bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (D:\Repositories\hexo-renderers\test\node_modules\bluebird\js\release\promise.js:729:18)
    at _drainQueueStep (D:\Repositories\hexo-renderers\test\node_modules\bluebird\js\release\async.js:93:12)
    at _drainQueue (D:\Repositories\hexo-renderers\test\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (D:\Repositories\hexo-renderers\test\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (D:\Repositories\hexo-renderers\test\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (internal/timers.js:464:21)

fixed on hexo server
image

fixed cannot find some modules which installed by yarn berry
@dimaslanjaka
Copy link
Contributor Author

@yoshinorin review pls, this already tested and working for external plugins installed with yarn berry on monorepo hexo site

@dimaslanjaka dimaslanjaka changed the title fix: cannot find installed module by yarn v3 fix: cannot find installed markdown-it plugin by yarn v3 May 22, 2023
@dimaslanjaka dimaslanjaka changed the title fix: cannot find installed markdown-it plugin by yarn v3 fix: cannot find installed markdown-it plugin by yarn v3 monorepo May 22, 2023
lib/renderer.js Show resolved Hide resolved
reorder the list of paths that are certain to the installation folder.
the user must have installed the library from npm, it is very rare to use a single file js module.
Copy link
Member

@yoshinorin yoshinorin left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you :)

@yoshinorin yoshinorin merged commit e4943e2 into hexojs:master May 27, 2023
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.

2 participants