Open mlm625 opened 3 years ago
This seems like a transpilation issue. Could you post what your tsconfig.json looks like?
Experiencing the same as OP. My tsconfig:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"jsx": "react-native",
"lib": ["dom", "esnext"],
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"strict": true,
"strictPropertyInitialization": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
}
}
My impression (take with a grain of salt, as I know nothing about node) is that something is wrong in reading the ormconfig.js
generally; using createConnection()
with no args does not seem to successfully read the config file as suggested by the TypeORM docs. I have a hunch that behavior is related to this migration behavior.
The same is happening to me. The issue is the same as here: https://github.com/TypeStrong/ts-node/issues/935
I think that the error is caused because ts-node
can only load commonjs
modules. I've tried to set "target": "commonjs"
in expo-sqlite
, recompiled and the error is gone, but now the same appears while importing @unimodules
dependency, so it needs to be set in every module 🤔
Here is my tsconfig.json
:
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"module": "commonjs",
"allowJs": true,
"esModuleInterop": true,
"moduleResolution": "node",
"strict": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"baseUrl": "./"
}
}
Any ideas? I really need to make the migrations work on expo.
@nmartinezb3 Just curious if you had any luck with this last year?
I am also facing this issue, any advice?
I'm playing with typeorm for my expo project, but I can't seem to generate an initial migration. I get the following error:
My ormconfig.js looks like: