nestjs / mapped-types

Configuration module for Nest framework (node.js) 🐺
https://nestjs.com
MIT License
372 stars 57 forks source link

class-transformer doesn't exist #1378

Closed zhuba-Ahhh closed 4 months ago

zhuba-Ahhh commented 4 months ago

Is there an existing issue for this?

Current behavior

When I try to use webpack to package, I get an error: class-transformer/storage doesn't exist

nest-demo@0.0.1 build:webpack /Users/yanwenjun/My/workplace/nest-demo nest build --webpack --webpackPath=./webpack.config.js

ERROR in ./nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/@nestjs/mapped-types/dist/type-helpers.utils.js 80:27-63 Module not found: Error: Can't resolve 'class-transformer/storage' in '/Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/@nestjs/mapped-types/dist' resolve 'class-transformer/storage' in '/Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/@nestjs/mapped-types/dist' Parsed request is a module using description file: /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/@nestjs/mapped-types/package.json (relative path: ./dist) resolve as module /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/@nestjs/mapped-types/dist/node_modules doesn't exist or is not a directory /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/@nestjs/mapped-types/node_modules doesn't exist or is not a directory /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/@nestjs/node_modules doesn't exist or is not a directory /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/node_modules doesn't exist or is not a directory looking for modules in /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules existing directory /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/class-transformer using description file: /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/class-transformer/package.json (relative path: .) using description file: /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/class-transformer/package.json (relative path: ./storage) no extension /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/class-transformer/storage doesn't exist .js /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/class-transformer/storage.js doesn't exist .ts /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/class-transformer/storage.ts doesn't exist .json /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/class-transformer/storage.json doesn't exist as directory /Users/yanwenjun/My/workplace/nest-demo/nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/class-transformer/storage doesn't exist looking for modules in /Users/yanwenjun/My/workplace/nest-demo/node_modules/.pnpm/node_modules /Users/yanwenjun/My/workplace/nest-demo/node_modules/.pnpm/node_modules/class-transformer doesn't exist /Users/yanwenjun/My/workplace/nest-demo/node_modules/node_modules doesn't exist or is not a directory looking for modules in /Users/yanwenjun/My/workplace/nest-demo/node_modules existing directory /Users/yanwenjun/My/workplace/nest-demo/node_modules/class-transformer using description file: /Users/yanwenjun/My/workplace/nest-demo/node_modules/class-transformer/package.json (relative path: .) using description file: /Users/yanwenjun/My/workplace/nest-demo/node_modules/class-transformer/package.json (relative path: ./storage) no extension /Users/yanwenjun/My/workplace/nest-demo/node_modules/class-transformer/storage doesn't exist .js /Users/yanwenjun/My/workplace/nest-demo/node_modules/class-transformer/storage.js doesn't exist .ts /Users/yanwenjun/My/workplace/nest-demo/node_modules/class-transformer/storage.ts doesn't exist .json /Users/yanwenjun/My/workplace/nest-demo/node_modules/class-transformer/storage.json doesn't exist as directory /Users/yanwenjun/My/workplace/nest-demo/node_modules/class-transformer/storage doesn't exist /Users/yanwenjun/My/workplace/node_modules doesn't exist or is not a directory /Users/yanwenjun/My/node_modules doesn't exist or is not a directory looking for modules in /Users/yanwenjun/node_modules /Users/yanwenjun/node_modules/class-transformer doesn't exist /Users/node_modules doesn't exist or is not a directory /node_modules doesn't exist or is not a directory @ ./nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/@nestjs/mapped-types/dist/index.js 23:27-58 @ ./nodemodules/.pnpm/@nestjs+mapped-types@2.0.5@nestjs+common@10.3.8_class-transformer@0.4.1_class-validator@0.14_trkzvzgzrsiyav5ekfhp5ta2cm/node_modules/@nestjs/mapped-types/index.js 6:9-26 @ ./src/user/dto/update-user.dto.ts 14:23-54 @ ./src/user/user.controller.ts 20:26-58 @ ./src/user/user.module.ts 12:26-54 @ ./src/app.module.ts 13:22-51 @ ./src/main.ts 4:21-44

webpack 5.90.1 compiled with 1 error in 1607 ms  ELIFECYCLE  Command failed with exit code 1.

Minimum reproduction code

https://github.com/zhuba-Ahhh/nest-demo

Steps to reproduce

npm i npm run build:webpack

When I try to use webpack to package, I get an error: class-transformer/storage doesn't exist

Expected behavior

No error

Package version

2.0.5

Node.js version

18.20.2

In which operating systems have you tested?

Other

I tried to lower the version but still got an error, or not use @nestjs/mapped-types, but still got an error

kamilmysliwiec commented 4 months ago

Thank you for taking the time to submit your report! From the looks of it, this could be better discussed on our Discord. If you haven't already, please join here and send a new post in the #⁠ 🐈 nestjs-help forum. Make sure to include a link to this issue, so you don't need to write it all again. We have a large community of helpful members, who will assist you in getting this to work.