VirtusLab-Open-Source/strapi-plugin-comments

Undeclared dependency when building with Strapi v4.8.1

hypnotoad08 opened this issue · 6 comments

When running npm run build with Strapi V4.8.1 and strapi-plugin-comments 2.2.8 getting an error during webpack.

Webpack █████████████████████████ building (63%) 1/1 entries 9399/9667 dep
endencies 2243/2723 modules 275 active
...ules@strapi\plugin-users-permissions\admin\src\hooks\useRolesList\reduc
er.js

ModuleNotFoundError: Module not found: Error: Package path ./addon/display/placeholder is not exported from package D:\GitHub\Strapi-test\node_modules\codemirror (see exports field in D:\GitHub\Strapi-test\node_modules\codemirror\package.json)

Opened an issue with Strapi and it was determined the issue is actually with strapi-pluglin-comments - "the issue is with the plugin strapi-plugin-comments, they've used dependencies in their plugin in this case codemirror but they've not declared it in their package.json so the plugin is using our version which is v6 which has breaking changes. So realistically, the plugin author needs to double check all deps they've used are declared in their package.json to avoid this happening in the future." - strapi/strapi#16100

Checking which dependency cause the issue.

Checking which dependency cause the issue.

It's codemirror, if I'm not mistaken.

Right it's directly used in the WYSIWYG Editor from Strapi. Fix should be in 1-2 hours.

@hypnotoad08 fix releases as part of v2.2.9 with all dependencies declared and upgraded (as well Strapi to 2.2.8)

Issue was caused by the Editor.ts file and dependency in there. We simply copied WYSIWYG from Strapi package without providing declared package (mistake, indeed). All was working till change of codemirror in code as we've been consuming this. Now our plugin is aligned with the Content Manager plugin file and this shouldn't happen.

BTW. Would be nice for Strapi to expose their WYSIWYG as a component to Design System :)

Please check and we'll close the issue.

Please check and we'll close the issue.

Can confirm 2.29 resolves the issue, thank you for the prompt fix!