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

[Bug]: o3r create + ng g app #2593

Open
mrednic-1A opened this issue Dec 13, 2024 · 3 comments
Open

[Bug]: o3r create + ng g app #2593

mrednic-1A opened this issue Dec 13, 2024 · 3 comments
Labels
bug Something isn't working priority:medium

Comments

@mrednic-1A
Copy link
Contributor

Package name

workspace

Package version

11.4.2

Reproduction steps

  • o3r create was run with the latest release 11.4.2
  • in the meantime 11.5 has been released
  • run ng g application

Current result

UPDATE apps/myotterapp/package.json (1120 bytes)

  • Installing packages (npm)...npm error code ERESOLVE
    npm error ERESOLVE unable to resolve dependency tree
    npm error
    npm error While resolving: [email protected]
    npm error Found: @o3r/[email protected]
    npm error node_modules/@o3r/core
    npm error @o3r/core@"~11.4.2" from the root project
    npm error peer @o3r/core@"^11.4.2" from @o3r/[email protected]
    npm error node_modules/@o3r/application
    npm error @o3r/application@"~11.4.2" from the root project
    npm error @o3r/application@"~11.4.2" from [email protected]
    npm error apps/myotterapp
    npm error [email protected]
    npm error node_modules/myotterapp
    npm error workspace apps\myotterapp from the root project
    npm error 1 more (myotterapp)
    npm error
    npm error Could not resolve dependency:
    npm error peer @o3r/core@"^11.5.2" from @o3r/[email protected]
    npm error node_modules/@o3r/logger
    npm error peer @o3r/logger@"^11.4.2" from @o3r/[email protected]
    npm error node_modules/@o3r/application
    npm error @o3r/application@"~11.4.2" from the root project

Expected result

the generator of the app to work and the versions installed for o3r packages to match the existing o3r versions on the monorepo (not a new version if this has been released in the meantime)

Additional comments

No response

@mrednic-1A mrednic-1A added bug Something isn't working triage labels Dec 13, 2024
@kpanot
Copy link
Contributor

kpanot commented Dec 18, 2024

Hi,

To make sure to reproduce correctly the bug can you confirm you run exactly the following command (mainly regarding the way to run ng):

npm create @o3r myotterproject
# select default values to both questions
cd ./myotterapp
npm exec ng g application myotterapp
# select default values to questions

I also wonder if it is not fixed by the PR #2569 which enforce ~ dependencies when adding the dependency

@matthieu-crouzet
Copy link
Contributor

The issue happens after a time period.

You have to generate your monorepo.
Wait until a new minor is published.
Generate an application.

Currently it will generate a new application and run (behind the scene) ng add @o3r/core --project-name <app-name>
The issue is that it will add the new version of @o3r/core instead of using the one from the mono-repo.

When generating an application, I would expect it to be generated with the current value of the mono-repo.
So I would expect that it run (behind the scene) ng add @o3r/core@<local-version-of-o3r-core> --project-name <app-name>.

@kpanot
Copy link
Contributor

kpanot commented Dec 23, 2024

Currently it will generate a new application and run (behind the scene) ng add @o3r/core --project-name <app-name> The issue is that it will add the new version of @o3r/core instead of using the one from the mono-repo.

When generating an application, I would expect it to be generated with the current value of the mono-repo. So I would expect that it run (behind the scene) ng add @o3r/core@<local-version-of-o3r-core> --project-name <app-name>.

The behavior described does not seem correct.
The command ng add is not run when using the Otter application generator, instead, the ng-add schematics of the locally already added @o3r/core package is scheduled.
The main different it that it will not let Ng determine the version to install.

Regarding the log, the issue reported here seems to be more relative to the package @o3r/[email protected] which has been added with the version 11.5 instead of 11.4.
A possible cause is that, as the setup process read the peerDependencies ranges to manually install the dependencies of the generated package, @o3r/logger can have been added with ^ instead of ~.
That is the reason why I wonder if the recent fix unforcing ~ from the peerDependency picked rage would not have fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:medium
Projects
None yet
Development

No branches or pull requests

3 participants