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

TypeError can't convert undefined to object #624

Open
2 of 9 tasks
JS-VG24 opened this issue Dec 6, 2024 · 0 comments
Open
2 of 9 tasks

TypeError can't convert undefined to object #624

JS-VG24 opened this issue Dec 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JS-VG24
Copy link

JS-VG24 commented Dec 6, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

Hej there,

it seems this project is not maintained anymore, which is quite sad as I having trouble with an Issue I'm confronted with right now. I will post it anyways in the hopes there will be a fork and the Issue gets resolved there!

I have a project that uses Database Entities with Snake-Case and Dto's with Camel-Case. This worked fine until I defined multiple fields starting with the same string like:

password and password_reset_token

then all hell brakes loose and the following error is thrown:

TypeError can't convert undefined to object hasProperty@https://2vqzsn.csb.app/node_modules/ automapper/core/index.js:1120:42 getFlatteningPaths@https://2vqzsn.csb.app/node_modules/ automapper/core/index.js:1111:32 processSourcePath@https://2vqzsn.csb.app/node_modules/ automapper/core/index.js:1352:22 _loop3@https://2vqzsn.csb.app/node_modules/ automapper/core/index.js:1277:39 createInitialMapping@https://2vqzsn.csb.app/node_modules/ automapper/core/index.js:1315:17 createMap@https://2vqzsn.csb.app/node_modules/ automapper/core/index.js:1413:13

I made a simple CodeSandbox example that shows the problem and how to reproduce it.

Hopefully that will help!

Cheers
Jan

Models/DTOs/VMs

See CodeSandbox example!

Mapping configuration

See CodeSandbox example!

Steps to reproduce

See CodeSandbox example!

Expected behavior

That the naming converter does not throw an error and allows for fields starting with the same string!

Screenshots

No response

Minimum reproduction code

https://codesandbox.io/p/sandbox/naughty-rgb-2vqzsn

Package

  • I don't know.
  • @automapper/core
  • @automapper/classes
  • @automapper/nestjs
  • @automapper/pojos
  • @automapper/mikro
  • @automapper/sequelize
  • Other (see below)

Other package and its version

No response

AutoMapper version

8.8.1

Additional context

No response

@JS-VG24 JS-VG24 added the bug Something isn't working label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant