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

Running build in watch mode for buildable node libraries does not generate a package.json as part of the output. #5724

Closed
DibyodyutiMondal opened this issue May 20, 2021 · 6 comments · Fixed by #5863
Assignees
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx type: bug

Comments

@DibyodyutiMondal
Copy link

DibyodyutiMondal commented May 20, 2021

Current Behavior

Running build in watch mode for buildable node libraries does not generate a package.json as part of the output.
This breaks incremental building as dependents of this library keep telling me that it is not built.

Expected Behavior

package.json should be generated in watch mode.
This was the behavior up to @nrwl/node v11.4.0.
After v11.4.0, watch mode was broken (#5208), which was fixed in v12.3.4

Workarounds

I wrote a watch target for the library:
I had to deliberately skip-nx-cache to avoid race condition, too

"watch": {
    "executor": "@nrwl/workspace:run-commands",
    "options": {
        "parallel": true,
        "commands": [
            {
                "command": "npx nx build models --watch"
            },
            {
                "command": "npx nx build models --skip-nx-cache"
            }
        ]
    }
},

Additonal info:

In @nrwl/node v11.4.0, the output for npx nx build project --watch would be

9:35:57 am - Starting compilation in watch mode...


9:35:59 am - Found 0 errors. Watching for file changes.
Copying asset files...   
Done copying asset files. 

In v12.3.4, the output is

1:19:33 pm - Starting compilation in watch mode...


1:19:34 pm - Found 0 errors. Watching for file changes.

This seems to suggest that in the v12.3.4 once it enters watch mode, no further additional processing is done, which was being done in v11.4.0

Environment

Node : 14.17.0
OS : win32 x64
npm : 7.13.0

nx : Not Found
@nrwl/angular : 12.3.4
@nrwl/cli : 12.3.4
@nrwl/cypress : 12.3.4
@nrwl/devkit : 12.3.4
@nrwl/eslint-plugin-nx : 12.3.4
@nrwl/express : Not Found
@nrwl/jest : 12.3.4
@nrwl/linter : 12.3.4
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : 12.3.4
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 12.3.4
@nrwl/web : Not Found
@nrwl/workspace : 12.3.4
@nrwl/storybook : Not Found
@nrwl/gatsby : Not Found
typescript : 4.2.4

@FrozenPandaz FrozenPandaz added the scope: node Issues related to Node, Express, NestJS support for Nx label May 22, 2021
@AgentEnder AgentEnder self-assigned this Jun 1, 2021
AgentEnder added a commit to AgentEnder/nx that referenced this issue Jun 1, 2021
@DibyodyutiMondal
Copy link
Author

Has this been released?

@AgentEnder
Copy link
Member

Hey @DibyodyutiMondal. This is in latest master, but has not been released yet. It should be part of the next patch or minor version, whichever comes first.

@DibyodyutiMondal
Copy link
Author

The issue has become worse in v12.6.0-next

Forget package.json, now there is absolutely no output at all

New issue or reopen this one?

@AgentEnder
Copy link
Member

@DibyodyutiMondal I'll check this out today, see if I can reproduce.

@DibyodyutiMondal
Copy link
Author

The problem seems resolved in v12.6.2

@github-actions
Copy link

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 Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants