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

@nrwl/js inline.ts postProcessInlinedDependencies tries to move the same inline library twice #16125

Closed
Itrulia opened this issue Apr 5, 2023 · 2 comments · Fixed by #16127
Closed

Comments

@Itrulia
Copy link
Contributor

Itrulia commented Apr 5, 2023

Current Behavior

If you want to export non buildable libraries inside a publishable libraries, the postProcessInlinedDependencies tries to move the same library multiple times.

As the library has already moved the first time, the 2nd time will fail and throw an error.

This is caused by the following line:

movePackage(depOutputPath, destDepOutputPath);

Expected Behavior

Build does not error

GitHub Repo

https://github.com/Itrulia/nrwl-js-postProcessInlinedDependencies-issue

Steps to Reproduce

  1. npm i
  2. npx nx build website

Nx Report

nrwl-js-postProcessInlinedDependencies-issue on  main via  v16.16.0 on ☁️  [email protected]
❯ nx report
>  NX  Falling back to ts-node for local typescript execution. This may be a little slower.
  - To fix this, ensure @swc-node/register and @swc/core have been installed

 >  NX   Report complete - copy this into the issue template

   Node : 16.16.0
   OS   : darwin arm64
   npm  : 8.11.0

   nx                      : 15.9.2
   lerna                   : 3.22.1
   @nrwl/js                : 15.9.2
   @nrwl/jest              : 15.9.2
   @nrwl/linter            : 15.9.2
   @nrwl/workspace         : 15.9.2
   @nrwl/cli               : 15.9.2
   @nrwl/cypress           : 15.9.2
   @nrwl/devkit            : 15.9.2
   @nrwl/eslint-plugin-nx  : 15.9.2
   @nrwl/next              : 15.9.2
   @nrwl/node              : 15.9.2
   @nrwl/react             : 15.9.2
   @nrwl/storybook         : 15.9.2
   @nrwl/tao               : 15.9.2
   @nrwl/web               : 15.9.2
   @nrwl/webpack           : 15.9.2
   @nrwl/nx-cloud          : 15.3.3
   typescript              : 4.6.4

Failure Logs

Log of Object.values(inlineGraph.dependencies):

[
  [
    'page-website',
    'article-website',
    'navigation-website',
    'richtext-website',
    'membership-website',
    'block-content-website',
    'authentication-website',
    'website-builder',
    'website-api',
    'website-api-v2'
  ],
  [ 'website-api', 'website-builder', 'block-content-website' ],
  [
    'website-api', 'website-api',
    'website-api', 'website-api',
    'website-api', 'website-api',
    'website-api', 'website-api',
    'website-api', 'website-api',
    'website-api', 'website-api'
  ],
  [
    'website-builder',
    'website-api',
    'richtext-website',
    'website-builder',
    'website-api',
    'richtext-website',
    'website-builder',
    'website-api',
    'richtext-website'
  ],
  [
    'website-builder',
    'website-builder',
    'website-builder',
    'website-builder'
  ],
  [ 'website-api', 'website-builder', 'block-content-website' ],
  [ 'website-api', 'website-builder' ],
  [ 'website-builder', 'website-api', 'authentication-website' ],
  [ 'website-api', 'website-api' ]
]


Log of depOutputPath, destDepOutputPath:


/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/page/website
/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/article/website
/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/navigation/website
/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/richtext/website
/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/membership/website
/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/block-content/website
/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/authentication/website
/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/website-builder
/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/website-api
/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/website-api-v2
/Users/itrulia/Documents/nrwl-js-postProcessInlinedDependencies-issue/dist/libs/website libs/website-api

Additional Information

This error is most likely happening because there are multiple libraries depending on the same library multiple times.

Itrulia added a commit to Itrulia/nx that referenced this issue Apr 5, 2023
Moved the deletion of the `libs` folder to a later stage, to avoid errors when multiple libraries depend on the same library.

fixes nrwl#16125
@Itrulia
Copy link
Contributor Author

Itrulia commented Apr 26, 2023

Still relevant so the bot doesn't mark it as stale

jaysoo pushed a commit to Itrulia/nx that referenced this issue May 31, 2023
Moved the deletion of the `libs` folder to a later stage, to avoid errors when multiple libraries depend on the same library.

fixes nrwl#16125
@github-actions
Copy link

github-actions bot commented Jul 1, 2023

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants