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

Share dependencies defined as npm aliases #593

Closed
MSSPL-KamalenduGarai opened this issue Apr 10, 2023 · 2 comments
Closed

Share dependencies defined as npm aliases #593

MSSPL-KamalenduGarai opened this issue Apr 10, 2023 · 2 comments
Labels
bug Something isn't working cli Concerns the piral-cli application.
Milestone

Comments

@MSSPL-KamalenduGarai
Copy link

MSSPL-KamalenduGarai commented Apr 10, 2023

Prerequisites

  • [ x] Are you running the latest version?
  • [ x] Did you perform a search in the issues?

Node - 16.13.1,
npm - 8.3.0
piral - 0.15.8

Description

Hi, I am trying to load multiple react js version 18 and 17 into the app cell so that I can share react@17 to the two of my pilets. You can check the screen shot of appCell package.json where you will find "react17": "npm:react@^17.0.2" which depicts how I have installed the dependency and have put "react17":"." as imports in import map section. Now, when I am creating a new pilet its showing me the error "Installing dependencies ...npm ERR! Cannot convert undefined or null to object". If I remove react17 from import map then its building fine. Will you please shed some light to it.

Expected behavior

It should get compiled without generating any error.

@MSSPL-KamalenduGarai MSSPL-KamalenduGarai added the bug Something isn't working label Apr 10, 2023
@FlorianRappl FlorianRappl changed the title Load multiple react js versions into the app cell so that It can share different version of reactjs to different pilets Share dependencies defined as npm aliases Apr 10, 2023
@FlorianRappl FlorianRappl added cli Concerns the piral-cli application. in-testing The item is already out in preview and can be tested. labels Apr 10, 2023
@FlorianRappl FlorianRappl added this to the 0.15.9 milestone Apr 10, 2023
@FlorianRappl
Copy link
Contributor

A fix for this is out in the preview version.

In general though, you should not really share such different versions via the shell, but rather as distributed dependencies from the pilets. Pilets are capable of using any kind of version - and also sharing this version. You should make use of this, as it will take off the version-management responsibility from the shell.

General rule of thumb: Only share from the shell what is already used by the shell or definitely used by some pilet that will always get loaded.

@FlorianRappl FlorianRappl removed the in-testing The item is already out in preview and can be tested. label Apr 11, 2023
@MSSPL-KamalenduGarai
Copy link
Author

That is a nice explanation. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Concerns the piral-cli application.
Projects
None yet
Development

No branches or pull requests

2 participants