You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your great work! I encountered a problem in use:
I have a .markdownlint-cli2.mjs in the project root directory, but when I open the md file, the plugin reports an error:
[17:00:00] ERROR: Exception while linting with markdownlint-cli2:
Error: Unable to use configuration file 'd:/Code/zotero-chinese/wiki/.markdownlint-cli2.mjs'; Unable to require or import module 'd:/Code/zotero-chinese/wiki/.markdownlint-cli2.mjs'.
stack:
at w (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9155)
at c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:13211
at async Promise.all (index 0)
at async c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17067
at async $ (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17002)
cause:
AggregateError: Unable to require or import module 'd:/Code/zotero-chinese/wiki/.markdownlint-cli2.mjs'.
stack:
at L (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9718)
errors:
Error: require() of ES Module d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs not supported.
Instead change the require of d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs to a dynamic import() which is available in all CommonJS modules.
stack:
Error [ERR_REQUIRE_ESM]: require() of ES Module d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs not supported.
Instead change the require of d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs to a dynamic import() which is available in all CommonJS modules.
at c._load (node:electron/js2c/node_init:2:13801)
at E._load (d:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:6051)
at i._load (d:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:174:31787)
at o._load (d:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:139:34334)
at g (d:\Program Files\Microsoft VS Code\resources\app\out\bootstrap-fork.js:2:647)
at e.exports (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:20509)
at L (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9542)
at c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:12977
at async Promise.all (index 0)
at async c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17067
at async $ (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17002)
TypeError: A dynamic import callback was not specified.
stack:
at importModuleDynamicallyCallback (node:internal/modules/esm/utils:228:9)
at L (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9661)
at c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:12977
at async Promise.all (index 0)
at async c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17067
at async $ (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17002)
[17:00:23] ERROR: Exception while linting with markdownlint-cli2:
Error: Unable to use configuration file 'd:/Code/zotero-chinese/wiki/.markdownlint-cli2.mjs'; Unable to require or import module 'd:/Code/zotero-chinese/wiki/.markdownlint-cli2.mjs'.
stack:
at w (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9155)
at c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:13211
at async Promise.all (index 0)
at async c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17067
at async $ (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17002)
cause:
AggregateError: Unable to require or import module 'd:/Code/zotero-chinese/wiki/.markdownlint-cli2.mjs'.
stack:
at L (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9718)
errors:
Error: require() of ES Module d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs not supported.
Instead change the require of d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs to a dynamic import() which is available in all CommonJS modules.
stack:
Error [ERR_REQUIRE_ESM]: require() of ES Module d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs not supported.
Instead change the require of d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs to a dynamic import() which is available in all CommonJS modules.
at c._load (node:electron/js2c/node_init:2:13801)
at E._load (d:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:6051)
at i._load (d:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:174:31787)
at o._load (d:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:139:34334)
at g (d:\Program Files\Microsoft VS Code\resources\app\out\bootstrap-fork.js:2:647)
at e.exports (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:20509)
at L (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9542)
at c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:12977
at async Promise.all (index 0)
at async c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17067
at async $ (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17002)
TypeError: A dynamic import callback was not specified.
stack:
at importModuleDynamicallyCallback (node:internal/modules/esm/utils:228:9)
at L (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9661)
at c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:12977
at async Promise.all (index 0)
at async c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17067
at async $ (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17002)
[17:03:40] ERROR: Exception while linting with markdownlint-cli2:
Error: Unable to use configuration file 'd:/Code/zotero-chinese/wiki/.markdownlint-cli2.mjs'; Unable to require or import module 'd:/Code/zotero-chinese/wiki/.markdownlint-cli2.mjs'.
stack:
at w (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9155)
at c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:13211
at async Promise.all (index 0)
at async c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17067
at async $ (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17002)
cause:
AggregateError: Unable to require or import module 'd:/Code/zotero-chinese/wiki/.markdownlint-cli2.mjs'.
stack:
at L (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9718)
errors:
Error: require() of ES Module d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs not supported.
Instead change the require of d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs to a dynamic import() which is available in all CommonJS modules.
stack:
Error [ERR_REQUIRE_ESM]: require() of ES Module d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs not supported.
Instead change the require of d:\Code\zotero-chinese\wiki\.markdownlint-cli2.mjs to a dynamic import() which is available in all CommonJS modules.
at c._load (node:electron/js2c/node_init:2:13801)
at E._load (d:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:6051)
at i._load (d:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:174:31787)
at o._load (d:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:139:34334)
at g (d:\Program Files\Microsoft VS Code\resources\app\out\bootstrap-fork.js:2:647)
at e.exports (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:20509)
at L (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9542)
at c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:12977
at async Promise.all (index 0)
at async c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17067
at async $ (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17002)
TypeError: A dynamic import callback was not specified.
stack:
at importModuleDynamicallyCallback (node:internal/modules/esm/utils:228:9)
at L (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:9661)
at c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:12977
at async Promise.all (index 0)
at async c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17067
at async $ (c:\Users\northword\.vscode\extensions\davidanson.vscode-markdownlint-0.55.0\bundle.js:37:17002)
I'm sure my config file is correct because when I change the suffix to cjs and export default to module.exports, it works fine.
It also works fine when running markdownlint-cli2 directly.
It seems this is caused by the plugin being cjs and not being able to load esm's? (I'm not sure)
Sorry, this is a VS Code limitation. I'd removed module support from the documentation long ago but added it back a release or two ago because it seemed to work after they made a change in this area. However, this has always worked at development time and I think I only checked that. This remains broken at run time and I have already made the commit to remove it from the documentation (again) for the next release: e96150c
The original issue is #248 and includes a link to the relevant VS Code issue.
Thanks for your great work! I encountered a problem in use:
I have a
.markdownlint-cli2.mjs
in the project root directory, but when I open the md file, the plugin reports an error:I'm sure my config file is correct because when I change the suffix to
cjs
andexport default
tomodule.exports
, it works fine.It also works fine when running markdownlint-cli2 directly.
It seems this is caused by the plugin being cjs and not being able to load esm's? (I'm not sure)
Below are my config files and package.json:
I would appreciate it if you could help me see what the problem is!
Thank you very much again!
The text was updated successfully, but these errors were encountered: