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

Can't resolve 'class-transformer/storage' #836

Open
orbanszlrd opened this issue Mar 5, 2022 · 2 comments
Open

Can't resolve 'class-transformer/storage' #836

orbanszlrd opened this issue Mar 5, 2022 · 2 comments

Comments

@orbanszlrd
Copy link

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

When I start the development server using npm run dev:ssr, I get the following error:

./node_modules/@nestjs/mapped-types/dist/type-helpers.utils.js:69:27-63 - Error: Module not found: Error: Can't resolve 'class-transformer/storage' in '/node_modules/@nestjs/mapped-types/dist'

Expected behavior

Starting the development server with no errors

p.s. : using an older version of class-transformer (v0.3.1) the server starts

Minimal reproduction of the problem with instructions

npm run dev:ssr

What is the motivation / use case for changing the behavior?

Using @nestjs/universal with the latest class-transformer

Environment


Nest version: 8.0.0

 
For Tooling issues:
- Node version: 16.13.2
- Platform:  Linux (Ubuntu)

Others:
- npm version: 8.1.2

package.json

{
  "name": "test-angular-nest",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "dev:ssr": "ng run test-angular-nest:serve-ssr",
    "serve:ssr": "node dist/test-angular-nest/server/main.js",
    "build:ssr": "ng build && ng run test-angular-nest:server",
    "prerender": "ng run test-angular-nest:prerender",
    "prebuild:ssr": "ngcc"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~13.2.0",
    "@angular/common": "~13.2.0",
    "@angular/compiler": "~13.2.0",
    "@angular/core": "~13.2.0",
    "@angular/forms": "~13.2.0",
    "@angular/platform-browser": "~13.2.0",
    "@angular/platform-browser-dynamic": "~13.2.0",
    "@angular/platform-server": "~13.2.0",
    "@angular/router": "~13.2.0",
    "@nestjs/common": "^8.0.0",
    "@nestjs/core": "^8.0.0",
    "@nestjs/mapped-types": "^1.0.1",
    "@nestjs/ng-universal": "^6.0.0",
    "@nestjs/platform-express": "^8.0.0",
    "@nguniversal/express-engine": "^13.0.1",
    "class-transformer": "^0.5.1",
    "class-validator": "^0.13.1",
    "express": "^4.15.2",
    "reflect-metadata": "^0.1.13",
    "rxjs": "~7.5.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.2.5",
    "@angular/cli": "~13.2.5",
    "@angular/compiler-cli": "~13.2.0",
    "@nestjs/testing": "^8.4.0",
    "@nguniversal/builders": "^13.0.1",
    "@types/express": "^4.17.0",
    "@types/jasmine": "~3.10.0",
    "@types/node": "^12.11.1",
    "jasmine-core": "~4.0.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.1.0",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "typescript": "~4.5.2"
  }
}
@pmknk
Copy link

pmknk commented Apr 10, 2023

just need to add "class-transformer/storage" to the externalDependencies in angular json for the server section

@natejgardner
Copy link

@pmknk's fix works!
Would be great if ng add @nestjs/ng-universal included this automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants