Why is the Typeorm require the react-native-sqlite-storage module that is not using in my project?

See original GitHub issue

Issue type:

[x] question [ ] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [x] mysql / mariadb [ ] oracle [ ] postgres [ ] cockroachdb [ ] sqlite [ ] sqljs [ ] react-native [ ] expo

TypeORM version:

[x] latest [ ] @next [ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

Hi ~ When I using typeorm with Next.js react framework… I got the warning message like this.

./node_modules/typeorm/browser/driver/react-native/ReactNativeDriver.js Module not found: Can't resolve 'react-native-sqlite-storage' in '/Users/chicrock/Documents/projects/node_modules/typeorm/browser/driver/react-native'

I only use mysql database in my project.

why is typeorm load the react-native-sqlite-storage module unnecessary to me.

Is this bug ? or something wrong to my usage ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:25 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
chicrockcommented, Mar 2, 2020

👀

4reactions
yuri-scarbaci-leniocommented, Feb 12, 2020

I’m using next.js 9.2 with postgresql and I was affected by this too.

@marcorinck solution works without any problem

in my case this created a problem of circular dependency and rejected promise without a catch

this is the log of the problem after I start the server that DOESN’T use sql-lite…

[ wait ]  starting the development server ...
[ info ]  waiting on http://localhost:3000 ...
> Using external babel configuration
> Location: "/Users/{my-user}/path/to/project/.babelrc"
[ warn ]  ./node_modules/typeorm/browser/driver/react-native/ReactNativeDriver.js
Module not found: Can't resolve 'react-native-sqlite-storage' in '/Users/{my-user}/path/to/project/node_modules/typeorm/browser/driver/react-native'
[ info ]  ready on http://localhost:3000
[ event ] build page: /next/dist/pages/_error
[ wait ]  compiling ...
[ warn ]  ./node_modules/typeorm/browser/driver/react-native/ReactNativeDriver.js
Module not found: Can't resolve 'react-native-sqlite-storage' in '/Users/{my-user}/path/to/project/node_modules/typeorm/browser/driver/react-native'
[ info ]  ready on http://localhost:3000
(node:15069) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'NormalModule'
    |     property 'dependencies' -> object with constructor 'Array'
    |     index 0 -> object with constructor 'HarmonyCompatibilityDependency'
    --- property 'originModule' closes the circle
    at JSON.stringify (<anonymous>)
    at /Users/{my-user}/path/to/project/node_modules/webpack-hot-middleware/middleware.js:111:38
    at /Users/{my-user}/path/to/project/node_modules/webpack-hot-middleware/middleware.js:66:7
    at Array.forEach (<anonymous>)
    at everyClient (/Users/{my-user}/path/to/project/node_modules/webpack-hot-middleware/middleware.js:65:26)
    at Object.publish (/Users/{my-user}/path/to/project/node_modules/webpack-hot-middleware/middleware.js:110:7)
    at Function.middleware.publish (/Users/{my-user}/path/to/project/node_modules/webpack-hot-middleware/middleware.js:48:17)
    at HotReloader.send (/Users/{my-user}/path/to/project/node_modules/next/dist/server/hot-reloader.js:5:640)
    at /Users/{my-user}/path/to/project/node_modules/next/dist/server/hot-reloader.js:15:508
    at /Users/{my-user}/path/to/project/node_modules/next/dist/build/output/index.js:5:651
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:15069) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15069) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

this is a really really weird and unexpected bug…

currently on

    "typeorm": "^0.2.22"
Read more comments on GitHub >

github_iconTop Results From Across the Web

I'm getting an error at run time when im using typeorm with ...
I installed typeorm(also react-native-sqlite-storage) to use it in react native, but i'm getting this error error: ...
Read more >
Supported platforms - typeorm - GitBook
TypeORM is able to run on React Native apps using the react-native-sqlite-storage plugin. For an example see typeorm/react-native-example.
Read more >
Setup TypeORM with React-Native
I've faced a great amount of trouble trying to successfully setup TypeORM with React-Native and this is my attempt to help.
Read more >
react-native-sqlite-storage
Start using react-native-sqlite-storage in your project by running `npm i ... Linking is not required in React Native 0.60 and above.
Read more >
docs/supported-platforms.md | typeorm@v0.2.23-rc6
TypeORM is able to on React Native apps using the react-native-sqlite-storage plugin. For an example see typeom/react-native-example.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found