sapphi-red / vitepress-plugins

Some vitepress plugins.
https://vitepress-plugins.sapphi.red/
MIT License
36 stars 3 forks source link

I'm getting an error when using `vitepress-plugin-tabs-0.2.0` with `vitepress-1.0.0-alpha.75`. Can you help me troubleshoot this issue? #22

Closed lxtqq closed 1 year ago

lxtqq commented 1 year ago

failed to load config from D:\IT\project\cattle-blog\docs.vitepress\config.ts failed to start server. error: Error [ERR_REQUIRE_ESM]: require() of ES Module D:\IT\project\cattle-blog\node_modules\vitepress-plugin-tabs\dist\index.js from D:\IT\project\cattle-blog\docs.vitepress\config.ts not supported. Instead change the require of index.js in D:\IT\project\cattle-blog\docs.vitepress\config.ts to a dynamic import() which is available in all CommonJS modules. at _require.extensions. [as .js] (file:///D:/IT/project/cattle-blog/node_modules/vite/dist/node/chunks/dep-a178814b.js:64435:17) at Object. (D:\IT\project\cattle-blog\docs.vitepress\config.ts:323:36) at _require.extensions. [as .js] (file:///D:/IT/project/cattle-blog/node_modules/vite/dist/node/chunks/dep-a178814b.js:64432:24) at loadConfigFromBundledFile (file:///D:/IT/project/cattle-blog/node_modules/vite/dist/node/chunks/dep-a178814b.js:64440:21) at async loadConfigFromFile (file:///D:/IT/project/cattle-blog/node_modules/vite/dist/node/chunks/dep-a178814b.js:64296:28) at async resolveUserConfig (file:///D:/IT/project/cattle-blog/node_modules/vitepress/dist/node/serve-998e6cdd.js:11123:27) at async resolveConfig (file:///D:/IT/project/cattle-blog/node_modules/vitepress/dist/node/serve-998e6cdd.js:11060:48) at async createServer (file:///D:/IT/project/cattle-blog/node_modules/vitepress/dist/node/serve-998e6cdd.js:37208:18) at async createDevServer (file:///D:/IT/project/cattle-blog/node_modules/vitepress/dist/node/cli.js:316:20)

sapphi-red commented 1 year ago

These plugins only support ESM. I guess it'll work if you renamed .vitepress/config.ts to .vitepress/config.mts.

sapphi-red commented 1 year ago

Closing due to lack of response.