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

Since update to NestJS 11 assets or only copied when it has ts file ending #14463

Closed
1 of 15 tasks
loxy opened this issue Jan 20, 2025 · 4 comments
Closed
1 of 15 tasks
Labels
needs triage This issue has not been looked into

Comments

@loxy
Copy link

loxy commented Jan 20, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Since update to Nest11 assets or only copied when it is ts file ending
Nothing more to add, it just works for code files. json for example it not working

Minimum reproduction code

https://stackblitz.com/edit/nestjs-typescript-starter-da1qvkpw?file=nest-cli.json

Steps to reproduce

No response

Expected behavior

It should copy all files, not only TypeScript

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

No response

NestJS version

11

Packages versions

Node.js version

No response

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@loxy loxy added the needs triage This issue has not been looked into label Jan 20, 2025
@loxy loxy changed the title Since update to Nest11 assets or only copied when it has ts file ending Since update to NestJS 11 assets or only copied when it has ts file ending Jan 20, 2025
@hopkins385
Copy link

Did you try to add the missing assets in the compilerOptions of the nest-cli.json?
Even before NestJs 11 we had to do it.

{
  "$schema": "https://json.schemastore.org/nest-cli",
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "generateOptions": {
    "baseDir": "modules"
  },
  "compilerOptions": {
    "deleteOutDir": true,
    "watchAssets": true,
    "plugins": [
      "@nestjs/swagger"
    ],
    "assets": [
      {
        "include": "modules/mail/templates",
        "outDir": "dist"
      }
    ]
  }
}

@loxy
Copy link
Author

loxy commented Jan 20, 2025

What do you mean? Take a look at Stackblitz. It is not working with 11

@AdrianCassar
Copy link

I've encountered the same issue since upgrading to v11. I resolved it by removing "watchAssets": true from assets.

@kamilmysliwiec
Copy link
Member

Fixed in @nestjs/cli@11.0.1 https://github.com/nestjs/nest-cli/releases/tag/11.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

No branches or pull requests

4 participants