Describe the bug
When using decap-cms-app in an Astro/Vite app, there are issues due incorrect import statements in the decap-cms-widget-richtext.
For example I get:
✘ [ERROR] No matching export in "node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/index.js" for import "default"
node_modules/.pnpm/decap-cms-widget-richtext@3.2.1_@emotion+react@11.14.0_@types+react@19.2.14_react@19.2.5__@em_hhy545oktf22w3cpgrsx7kwr6i/node_modules/decap-cms-widget-richtext/dist/esm/serializers/remarkAssertParents.js:2:7:
2 │ import visitParents from 'unist-util-visit-parents';
╵ ~~~~~~~~~~~~
visitParents is a named export of unist-util-visit-parents, not a default export so the resolution fails here:
|
import visitParents from 'unist-util-visit-parents'; |
The same issue is present for the import of mdastDefinitions here:
|
import mdastDefinitions from 'mdast-util-definitions'; |
Expected behavior
The imports should be correct
Applicable Versions:
- Decap CMS version:
"decap-cms-app": "^3.12.2"
- OS: macOS
- Browser version: Firefox 150
- Node.JS version: 24.15
CMS configuration
This happens with any config, even when not using the rich text widget
Describe the bug
When using
decap-cms-appin an Astro/Vite app, there are issues due incorrect import statements in thedecap-cms-widget-richtext.For example I get:
visitParentsis a named export ofunist-util-visit-parents, not a default export so the resolution fails here:decap-cms/packages/decap-cms-widget-richtext/src/serializers/remarkAssertParents.js
Line 2 in 6ef2f9b
The same issue is present for the import of
mdastDefinitionshere:decap-cms/packages/decap-cms-widget-richtext/src/serializers/remarkSquashReferences.js
Line 3 in 6ef2f9b
Expected behavior
The imports should be correct
Applicable Versions:
"decap-cms-app": "^3.12.2"CMS configuration
This happens with any config, even when not using the rich text widget