Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Error: Can't resolve '@strapi/design-system/Carousel' #568

Closed
krazylearner opened this issue Mar 7, 2022 · 11 comments
Closed

Comments

@krazylearner
Copy link

"node": "14.18.1",
"npm": "6.14.15"
"os" : windows

Getting this error . It looks this folder is missing https://github.com/strapi/design-system/tree/main/packages/strapi-design-system/src/carousel

Please fix this asap

ModuleNotFoundError: Module not found: Error: Can't resolve '@strapi/design-system/Carousel' in 'D:\project\node_modules\@strapi\plugin-upload\admin\src\components\MediaLibraryInput\Carousel' at D:\project\node_modules\webpack\lib\Compilation.js:1765:28 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:730:13 at eval (eval at create (D:\project\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:10:1) at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:273:22 at eval (eval at create (D:\project\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1) at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:402:22 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:117:11 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:646:24 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:800:8 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:920:5 at D:\project\node_modules\neo-async\async.js:6883:13 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:903:45 at finishWithoutResolve (D:\project\node_modules\enhanced-resolve\lib\Resolver.js:296:11) at D:\project\node_modules\enhanced-resolve\lib\Resolver.js:362:15 at D:\project\node_modules\enhanced-resolve\lib\Resolver.js:410:5 at eval (eval at create (D:\project\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1) resolve '@strapi/design-system/Carousel' in 'D:\project\node_modules\@strapi\plugin-upload\admin\src\components\MediaLibraryInput\Carousel' Parsed request is a module using description file: D:\project\node_modules\@strapi\plugin-upload\package.json (relative path: ./admin/src/components/MediaLibraryInput/Carousel) Field 'browser' doesn't contain a valid alias configuration resolve as module D:\project\node_modules\@strapi\plugin-upload\admin\src\components\MediaLibraryInput\Carousel\node_modules doesn't exist or is not a directory D:\project\node_modules\@strapi\plugin-upload\admin\src\components\MediaLibraryInput\node_modules doesn't exist or is not a directory D:\project\node_modules\@strapi\plugin-upload\admin\src\components\node_modules doesn't exist or is not a directory D:\project\node_modules\@strapi\plugin-upload\admin\src\node_modules doesn't exist or is not a directory D:\project\node_modules\@strapi\plugin-upload\admin\node_modules doesn't exist or is not a directory looking for modules in D:\project\node_modules\@strapi\plugin-upload\node_modules D:\project\node_modules\@strapi\plugin-upload\node_modules\@strapi\design-system doesn't exist D:\project\node_modules\@strapi\node_modules doesn't exist or is not a directory D:\project\node_modules\node_modules doesn't exist or is not a directory looking for modules in D:\project\node_modules existing directory D:\project\node_modules\@strapi\design-system using description file: D:\project\node_modules\@strapi\design-system\package.json (relative path: .) using description file: D:\project\node_modules\@strapi\design-system\package.json (relative path: ./Carousel) no extension Field 'browser' doesn't contain a valid alias configuration D:\project\node_modules\@strapi\design-system\Carousel doesn't exist .js Field 'browser' doesn't contain a valid alias configuration D:\project\node_modules\@strapi\design-system\Carousel.js doesn't exist .jsx Field 'browser' doesn't contain a valid alias configuration D:\project\node_modules\@strapi\design-system\Carousel.jsx doesn't exist .react.js Field 'browser' doesn't contain a valid alias configuration D:\project\node_modules\@strapi\design-system\Carousel.react.js doesn't exist as directory D:\project\node_modules\@strapi\design-system\Carousel doesn't exist D:\node_modules doesn't exist or is not a directory D:\node_modules doesn't exist or is not a directory ModuleNotFoundError: Module not found: Error: Can't resolve '@strapi/design-system/Carousel' in 'D:\project\node_modules\@strapi\plugin-upload\admin\src\components\MediaLibraryInput\Carousel' at D:\project\node_modules\webpack\lib\Compilation.js:1765:28 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:730:13 at eval (eval at create (D:\project\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:10:1) at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:273:22 at eval (eval at create (D:\project\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1) at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:402:22 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:117:11 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:646:24 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:800:8 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:920:5 at D:\project\node_modules\neo-async\async.js:6883:13 at D:\project\node_modules\webpack\lib\NormalModuleFactory.js:903:45 at finishWithoutResolve (D:\project\node_modules\enhanced-resolve\lib\Resolver.js:296:11) at D:\project\node_modules\enhanced-resolve\lib\Resolver.js:362:15 at D:\project\node_modules\enhanced-resolve\lib\Resolver.js:410:5 at eval (eval at create (D:\project\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1) resolve '@strapi/design-system/Carousel' in 'D:\project\node_modules\@strapi\plugin-upload\admin\src\components\MediaLibraryInput\Carousel' Parsed request is a module using description file: D:\project\node_modules\@strapi\plugin-upload\package.json (relative path: ./admin/src/components/MediaLibraryInput/Carousel) Field 'browser' doesn't contain a valid alias configuration resolve as module D:\project\node_modules\@strapi\plugin-upload\admin\src\components\MediaLibraryInput\Carousel\node_modules doesn't exist or is not a directory D:\project\node_modules\@strapi\plugin-upload\admin\src\components\MediaLibraryInput\node_modules doesn't exist or is not a directory D:\project\node_modules\@strapi\plugin-upload\admin\src\components\node_modules doesn't exist or is not a directory D:\project\node_modules\@strapi\plugin-upload\admin\src\node_modules doesn't exist or is not a directory D:\project\node_modules\@strapi\plugin-upload\admin\node_modules doesn't exist or is not a directory looking for modules in D:\project\node_modules\@strapi\plugin-upload\node_modules D:\project\node_modules\@strapi\plugin-upload\node_modules\@strapi\design-system doesn't exist D:\project\node_modules\@strapi\node_modules doesn't exist or is not a directory D:\project\node_modules\node_modules doesn't exist or is not a directory looking for modules in D:\project\node_modules existing directory D:\project\node_modules\@strapi\design-system using description file: D:\project\node_modules\@strapi\design-system\package.json (relative path: .) using description file: D:\project\node_modules\@strapi\design-system\package.json (relative path: ./Carousel) no extension Field 'browser' doesn't contain a valid alias configuration D:\project\node_modules\@strapi\design-system\Carousel doesn't exist .js Field 'browser' doesn't contain a valid alias configuration D:\project\node_modules\@strapi\design-system\Carousel.js doesn't exist .jsx Field 'browser' doesn't contain a valid alias configuration D:\project\node_modules\@strapi\design-system\Carousel.jsx doesn't exist .react.js Field 'browser' doesn't contain a valid alias configuration D:\project\node_modules\@strapi\design-system\Carousel.react.js doesn't exist as directory D:\project\node_modules\@strapi\design-system\Carousel doesn't exist D:\node_modules doesn't exist or is not a directory D:\node_modules doesn't exist or is not a directory npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! myproject@0.1.0 build: strapi build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myprojecti@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\USER\AppData\Roaming\npm-cache_logs\2022-03-07T11_19_42_847Z-debug.log`

@HichamELBSI
Copy link
Collaborator

HichamELBSI commented Mar 7, 2022

Hello @krazylearner, the Carousel component has been renamed to CarouselInput in a previous alpha version to match the input components naming (NumberInput, TextInput, ToggleInput, etc).

@krazylearner
Copy link
Author

@HichamELBSI Okay but this component is used by @strapi\plugin-upload. So how to fix this dependency ? It looks @strapi\plugin-upload is still using the old component name

@HichamELBSI
Copy link
Collaborator

I confirm that Carousel is no longer used in Strapi. Which version of Strapi are you using?

@krazylearner
Copy link
Author

@HichamELBSI I am using this version @strapi/strapi": "4.0.0",

@HichamELBSI
Copy link
Collaborator

HichamELBSI commented Mar 7, 2022

Strapi v4.0.0 is using the version 0.0.1-alpha.76 of the Design System where Carousel is still in the package. How can you get this error? Did you update the Design system version?

@krazylearner
Copy link
Author

@HichamELBSI I am not sure. I was trying to install some dependencies . I installed this package https://www.npmjs.com/package/@strapi/provider-upload-cloudinary and started to see this error. Aftar that I did lot of install and uninstall and my package json file was also changed.

@krazylearner
Copy link
Author

@HichamELBSI Also Please check this stack overflow thread. It is somewhat related to what I am facing

@HichamELBSI
Copy link
Collaborator

Please make sure the design system version is not changed or update your Strapi version to the latest.
This stack overflow thread isn't related to your problem.

@HichamELBSI
Copy link
Collaborator

FYI, the @strapi/provider-upload-cloudinary provider will not change the DS version.

@krazylearner
Copy link
Author

krazylearner commented Mar 7, 2022

@HichamELBSI I have updated to latest strapi version and that issue is gone but now I am getting another issue

`D:\oapps\myproj>npm run develop

proa@0.1.0 develop
strapi develop

[2022-03-07 23:54:45.921] debug: ⛔️ Server wasn't able to start properly.
[2022-03-07 23:54:45.923] error: Could not load js config file D:\oapps\myproj\node_modules@strapi\plugin-upload\strapi-server.js:
Something went wrong installing the "sharp" module

The specified module could not be found.
\?\D:\oapps\myproj\node_modules@strapi\plugin-upload\node_modules\sharp\build\Release\sharp-win32-x64.node

Possible solutions:

  • Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"
  • Install for the current win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
  • Consult the installation documentation: https://sharp.pixelplumbing.com/install
    Error: Could not load js config file D:\oapps\myproj\node_modules@strapi\plugin-upload\strapi-server.js:
    Something went wrong installing the "sharp" module

The specified module could not be found.
\?\D:\oapps\myproj\node_modules@strapi\plugin-upload\node_modules\sharp\build\Release\sharp-win32-x64.node

Possible solutions:

  • Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"
  • Install for the current win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
  • Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at loadJsFile (D:\oapps\myproj\node_modules@strapi\strapi\lib\core\app-configuration\load-config-file.js:18:11)
    at loadFile (D:\oapps\myproj\node_modules@strapi\strapi\lib\core\app-configuration\load-config-file.js:35:14)
    at Object.loadPlugins (D:\oapps\myproj\node_modules@strapi\strapi\lib\core\loaders\plugins\index.js:96:26)
    at async Strapi.loadPlugins (D:\oapps\myproj\node_modules@strapi\strapi\lib\Strapi.js:277:5)
    at async Promise.all (index 1)
    at async Strapi.register (D:\oapps\myproj\node_modules@strapi\strapi\lib\Strapi.js:309:5)
    at async Strapi.load (D:\oapps\myproj\node_modules@strapi\strapi\lib\Strapi.js:407:5)
    at async Strapi.start (D:\oapps\myproj\node_modules@strapi\strapi\lib\Strapi.js:161:9)

D:\oapps\myproj>

`

Please can you help ?

It looks the issue is coming from sharp module. If I comment out the sharp module from strapi-plugin-upload then it works fine

@HichamELBSI
Copy link
Collaborator

Try to run npm rebuild sharp at the root of the repo. The issue is closed and this problem isn't related to the design system. Please open another one only if it is related to the design system and read the Strapi contributing guide and the Strapi Design System contributing guide before you open an issue.

@strapi strapi locked as resolved and limited conversation to collaborators Mar 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants