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
hi, when component builds inside vitepress, it's fails with error:
✖ rendering pages...
build error:
file:///Users/path-to-project/docs/.vitepress/.temp/SomeComponent.c214d190.js:4
import { Sortable } from "sortablejs-vue3";
^^^^^^^^
SyntaxError: Named export 'Sortable' not found. The requested module 'sortablejs-vue3' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'sortablejs-vue3';
const { Sortable } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
to handle such cases with different environments, need to change the extension of the file from .es.js to .es.mjs in package.json and vite.config of this project.
checked locally with the this changes, project builds without errors and everything works
The text was updated successfully, but these errors were encountered:
tldr: vuejs/vitepress#1399 (comment)
hi, when component builds inside vitepress, it's fails with error:
to handle such cases with different environments, need to change the extension of the file from
.es.js
to.es.mjs
in package.json and vite.config of this project.checked locally with the this changes, project builds without errors and everything works
The text was updated successfully, but these errors were encountered: