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

Module not found StringUtils #8656

Closed
XerxesAkaEnno opened this issue Feb 17, 2022 · 20 comments · Fixed by #8660
Closed

Module not found StringUtils #8656

XerxesAkaEnno opened this issue Feb 17, 2022 · 20 comments · Fixed by #8660

Comments

@XerxesAkaEnno
Copy link

XerxesAkaEnno commented Feb 17, 2022

Issue Description

After updating to version 0.2.42 I get an error on my next js application which says "Module not Found ../typeorm/util/StringUtils"
Seems like its no exported any more.

Expected Behavior

The StringUtils should be exported, for minor version.

Actual Behavior

  StringUtils are not exported to implement as module

Steps to Reproduce

For example load up a Next JS Project with Next-Auth which has Typeorm as dependency.  

My Environment

Dependency Version
Operating System
Node.js version x.y.zzz
Typescript version x.y.zzz
TypeORM version x.y.zzz

Additional Context

Relevant Database Driver(s)

DB Type Reproducible
aurora-data-api no
aurora-data-api-pg no
better-sqlite3 no
cockroachdb no
cordova no
expo no
mongodb no
mysql no
nativescript no
oracle no
postgres no
react-native no
sap no
sqlite no
sqlite-abstract no
sqljs no
sqlserver no

Are you willing to resolve this issue by submitting a Pull Request?

  • ✖️Yes, I have the time, and I know how to start.
  • ✖️ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️ No, I don’t have the time, but I can support (using donations) development.
  • ✅ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
@visarya
Copy link

visarya commented Feb 17, 2022

facing the same issue

@XerxesAkaEnno
Copy link
Author

XerxesAkaEnno commented Feb 17, 2022

@visarya
As a workaround for projects or dependencies following works:

This workaround works on my pipeline.

Project Step:

  1. Add to the package.json following: "typeorm": "^0.2.42",
    The package wouldn't be downloaded again because an dependency already had it.

Pipeline Steps/Local Steps
2. run npm install

  1. run npm remove typeorm

  2. run npm install typeorm@0.2.41

@anuragteapot
Copy link

facing the same issue. Even i was on old version ^0.2.25. My deployments are failing suddenly

@spalt08
Copy link

spalt08 commented Feb 17, 2022

Related:

tonivj5/typeorm-naming-strategies#16

@pleerock
Copy link
Member

pleerock commented Feb 17, 2022

we can export StringUtils, it's not an issue. But the question is what change bring this error. I bet it's something related to new ESM support. @giladgd do you have any ideas if your PR #8536 could introduce this kind of issue?

@anuragteapot
Copy link

I am wondering how its affecting older versions ? ^0.2.25

@pleerock
Copy link
Member

I am wondering how its affecting older versions ? ^0.2.25

it doesn't affect old version, because of ^ it installs the latest right now on your machine.

@nallenscott
Copy link

Appears to be related to ESM:

Screen Shot 2022-02-17 at 9 48 08 AM

@pleerock
Copy link
Member

any hints on how to reproduce this issue at it's minimal (without other big dependencies like nestjs, etc)

@spalt08
Copy link

spalt08 commented Feb 17, 2022

@pleerock Just use the typeorm-naming-strategies package (snake case strategy for example) in your connection config

@anuragteapot
Copy link

I am wondering how its affecting older versions ? ^0.2.25

it doesn't affect old version, because of ^ it installs the latest right now on your machine.

Yes minor version issue.

@giladgd
Copy link
Contributor

giladgd commented Feb 17, 2022

@pleerock I managed to reproduce the issue and fix it.
I've opened #8660 to fix this issue

giladgd added a commit to giladgd/typeorm that referenced this issue Feb 17, 2022
pleerock pushed a commit that referenced this issue Feb 17, 2022
@pleerock
Copy link
Member

@giladgd thanks for urgent response, fix was released in 0.2.43.

@k-patton
Copy link

I am seeing this issue again in version 0.2.44

@giladgd
Copy link
Contributor

giladgd commented Feb 25, 2022

@k-patton I tried to reproduce it but this problem didn't occur to me.
Could you please provide me with an example project where it happens to you?

@kenchoong
Copy link

kenchoong commented Feb 28, 2022

I using typeorm 0.2.44

use it with Nx. Having the same issue as above.

and I still havent find out which part is possible going wrong

@nastari
Copy link

nastari commented Mar 6, 2022

same problem.... sad

@Alvaro948
Copy link

Same issue with typeorm@0.2.45

@adamskrodzki
Copy link

In hope that this will help anybody.

In my case problem was fixed by using node v16.13.0 instead of v14.18.1

@eldpswp99
Copy link

I had this issue when using jest v28 with typeorm@0.2.45.

I fixed this problem by downgrading jest to 27.5.1

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

Successfully merging a pull request may close this issue.