VirtusLab-Open-Source / strapi-plugin-comments

A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
MIT License
414 stars 65 forks source link

Plugin is failing when clean and build after strapi upgrade #96

Closed du0ngtrunghieu closed 2 years ago

du0ngtrunghieu commented 2 years ago

Bug report

Getting ModuleNotFoundError when building the plugin with strapi 4.0.3

Describe the bug

ModuleNotFoundError: Module not found: Error: Can't resolve './getApiURL' in './node_modules/strapi-plugin-comments/admin/src/utils

I am getting this when trying to build after the upgrade for strapi 4.0.3 A clear and concise description of what the bug is.

Steps to reproduce the behavior Upgrade strapi to 4.0.3 Run npm run build --clean The error shows up Expected behavior Run run build without error

System Node.js version: Tested with version 14 (npm v8.3.0) and 16 (npm v8.1.0) Strapi version: 4.0.3 Plugin version: 2.0.0-beta.3 Database: Postgressql Operating system: locally

cyp3rius commented 2 years ago

Thanks for reporting @du0ngtrunghieu. Investigating your scenario.

cyp3rius commented 2 years ago

@du0ngtrunghieu I've tried to reproduce your case but without same result. Ofc node version and npm is a bit different but it shouldn't be a case. See screenshot.

Screenshot 2022-01-07 at 21 48 56

Try please to cleanup cache and / or use fresh strapi installation. Done same for new and existing project.

du0ngtrunghieu commented 2 years ago

@cyp3rius I still have the same problem after reinstalling strapi new project new ver node : v16.13.1. See screenshot. bug

cyp3rius commented 2 years ago

Exact same env as your and works still. The only diff is operating OS. @Kronos66 can you check on linux?

Screenshot 2022-01-08 at 10 05 18

du0ngtrunghieu commented 2 years ago

@cyp3rius Hi sir, I found the problem : Webpack thinks there are two files whose names differs only in case only .It will be an exception if the code is run on linux or other os with case-sensitive filesystem. I renamed the file , and changed the path and it worked getApiUrl.js -> getApiURL.js. See screenshot. Screenshot-2022-01-08-193727

cyp3rius commented 2 years ago

Good spot @du0ngtrunghieu . Let us check other files and apply your finding as a new version. Am I correct, that after this change all works as expected?

du0ngtrunghieu commented 2 years ago

@cyp3rius yeah everything will work as expected, i have been in similar situation before. HANWE :tada:

cyp3rius commented 2 years ago

@du0ngtrunghieu fix made by @Kronos66 releases as part of v2.0.0-beta.4.