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

Parcel2 + TypeORM #8709

Closed
andrewvmail opened this issue Mar 1, 2022 · 6 comments · Fixed by #8710
Closed

Parcel2 + TypeORM #8709

andrewvmail opened this issue Mar 1, 2022 · 6 comments · Fixed by #8710

Comments

@andrewvmail
Copy link

Issue Description

Latest version of TypeORM does not play well with Parcel 2

Expected Behavior

Can build using Parcel 2

Actual Behavior

Uncaught TypeError: Cannot destructure property 'ConnectionOptionsReader' of '_indexJsDefault.default' as it is undefined.
    at Object.dmLkU../index.js (index.2d3ace14.js:47854:9)
    at newRequire (index.2d3ace14.js:71:24)
    at localRequire (index.2d3ace14.js:84:35)
    at Object.ign3V.@swc/helpers (index.2d3ace14.js:45833:16)
    at newRequire (index.2d3ace14.js:71:24)
    at localRequire (index.2d3ace14.js:84:35)
    at Object.4aBH6.typeorm/browser (index.2d3ace14.js:524:17)
    at newRequire (index.2d3ace14.js:71:24)
    at index.2d3ace14.js:122:5
    at index.2d3ace14.js:145:3
dmLkU../index.js @ index.mjs:3
newRequire @ index.2d3ace14.js:71
localRequire @ index.2d3ace14.js:84
ign3V.@swc/helpers @ Category.ts:1
newRequire @ index.2d3ace14.js:71
localRequire @ index.2d3ace14.js:84
4aBH6.typeorm/browser @ index.tsx:3
newRequire @ index.2d3ace14.js:71
(anonymous) @ index.2d3ace14.js:122
(anonymous) @ index.2d3ace14.js:145

Steps to Reproduce

// insert code here
# using latest typeorm ^0.2.43
git clone git@github.com:andrewvmail/typeorm-parcel-2-bug.git
git checkout b96d5651035d04db134837679d4cb9f7ce5cde7b
yarn
yarn start # see console for error logs

# using 0.2.25
git checkout main
yarn
yarn start # console shows now errors

My Environment

Dependency Version
Operating System
Node.js version 15.14.0
Typescript version 4.5.5
TypeORM version 0.2.43

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 yes
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.
@andrewvmail
Copy link
Author

reopening, coming from #8689

@andrewvmail
Copy link
Author

@giladgd, help

@giladgd
Copy link
Contributor

giladgd commented Mar 1, 2022

@andrewvmail
I did these steps and it worked for me without any problems:

git clone https://github.com/andrewvmail/typeorm-parcel-2-bug.git
cd typeorm-parcel-2-bug
git checkout b96d5651035d04db134837679d4cb9f7ce5cde7b
yarn
yarn add typeorm # it updated typeorm to 0.2.44
yarn start
----------------
yarn run v1.22.17
$ parcel src/index.html
Server running at http://localhost:1234
✨ Built in 1.61s

I also tried this and it worked right away:

git clone https://github.com/andrewvmail/typeorm-parcel-2-bug.git
cd typeorm-parcel-2-bug
yarn
yarn start
----------------
yarn run v1.22.17
$ parcel src/index.html
Server running at http://localhost:1234
✨ Built in 1.61s

Maybe try doing this to fix it on your machine:

rm -rf ./.parcel-cache ./node_modules ./yarn.lock ./package-lock.json
yarn
yarn add typeorm
yarn start

And make sure to update the nodejs version you're using

@andrewvmail
Copy link
Author

It passes the parcel build fine but the error comes from the browser console

0.2.43
image

0.2.25
image

@giladgd
Copy link
Contributor

giladgd commented Mar 1, 2022

Thanks @andrewvmail :)
@pleerock I've opened #8710 to fix this issue

pleerock pushed a commit that referenced this issue Mar 1, 2022
@pleerock
Copy link
Member

pleerock commented Mar 1, 2022

thank you @giladgd

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.

3 participants