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

fix(): copy all assets on build #1829

Merged
merged 1 commit into from Dec 27, 2022
Merged

fix(): copy all assets on build #1829

merged 1 commit into from Dec 27, 2022

Conversation

greg-md
Copy link
Contributor

@greg-md greg-md commented Nov 3, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #1828

What is the new behavior?

Will copy all the assets configured on build.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

};

setTimeout(closeFn, timeoutMs);
this.watchers.forEach((watcher) => watcher.close());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.watchers.forEach((watcher) => watcher.close());
this.watchers.forEach((watcher) => watcher.close());

AFAIR close() returns a Promise

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same as before. Is there a problem with that?

@@ -96,6 +78,10 @@ export class AssetsManager {
.on('change', (path: string) => this.actionOnFile({ ...option, path, action: 'change' }))
.on('unlink', (path: string) => this.actionOnFile({ ...option, path, action: 'unlink' }));

if (!isWatchEnabled) {
watcher.on('ready', () => watcher.close());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Watcher event listener return type is void, so it will not listen to the promise.

@greg-md
Copy link
Contributor Author

greg-md commented Nov 28, 2022

@kamilmysliwiec any updates on this?

@kamilmysliwiec kamilmysliwiec merged commit b956164 into nestjs:master Dec 27, 2022
@greg-md greg-md deleted the fix-build-assets branch December 27, 2022 13:51
@kamilmysliwiec
Copy link
Member

#1865 (comment)

@ydhn
Copy link
Contributor

ydhn commented Jan 25, 2023

Is there any plan to reimplement this issue?
After reverting this PR since 9.1.8, still this issue happens occasionally and I'm still using 9.1.7 since it works well without the watchAssets flag

@greg-md
Copy link
Contributor Author

greg-md commented Jan 25, 2023

Hm, @kamilmysliwiec was there any issue with this fix?

@ydhn
Copy link
Contributor

ydhn commented Feb 2, 2023

@greg-md
There was an issue after this PR merged: #1865 (comment)

@greg-md
Copy link
Contributor Author

greg-md commented Mar 31, 2023

@kamilmysliwiec still not fixed in master?

@kamilmysliwiec
Copy link
Member

kamilmysliwiec commented Mar 31, 2023

#1865 (comment)

It introduced a major regression

@nestjs nestjs locked and limited conversation to collaborators Mar 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants