-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
ERROR: Error reading "src/core/database/config.ts". #1099
Comments
Same stuff in here; I historically had these npm scripts : {
"db:migrate": "yarn sequelize:ts db:migrate",
"sequelize:ts": "ts-node ./node_modules/.bin/sequelize"
} Working perfectly on sequelize-cli@6.2.0; but breaking on @6.4.1 with : ERROR: Error reading "src/database/_config.ts". Error: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for [...]/api/src/database/_config.ts sequelizerc looks like this :
|
I Faced the same problem on run sequelize migrations |
How I can downgrade sequelize/cli version on 6.3.0 with npm? |
Alternatively, you can try typing npm uninstall sequelize/cli, then write manually npm i sequelize-cli@6.3.0 |
Thanks a lot |
thank you it work for me |
downgrading to 6.3.0 from 6.6.1 helped me too, what is the status of fixing this issue, I think there's something under the hood not supporting typescript files, whether not reading it, who knows? I can contribute to fixing it, just tell me where can I fix it or some details related |
Hi still not being solved? |
Hi
Problem is solved
Just downgrade sequelize-cli to v.6.3.0
вс, 5 нояб. 2023 г., 11:54 Alvin Cris Uy ***@***.***>:
… Hi still not being solved?
—
Reply to this email directly, view it on GitHub
<#1099 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZIP4NOW7U7VTGMQNK26OMTYC5H6HAVCNFSM5XH7BPO2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZZGM3DONRZG4ZA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
What I mean is without downgrading? |
See sequelize/cli#1099 "closed as completed" my rear end...
At this moment this still exist. |
Also just ran into this issue today. Still unfixed as of CLI 6.6.2 |
how come you closed this ticket @halilbaydar ? |
Joining the party
After downgrading
|
Can confirm that I also had to downgrade to 6.3.0 |
I am facing same issue did you find any solution ? |
@zohaibamir203 I'm now on {
"compilerOptions": {
"target": "es2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"rootDir": "./src",
"sourceMap": true,
"outDir": "./dist",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitAny": false,
"skipLibCheck": true,
"allowJs": true,
"checkJs": false,
"experimentalDecorators": true
},
"include": [
"src/**/*.ts",
"src/**/*.js"
],
"exclude": [
"node_modules"
]
} and in "type": "module",
"scripts": {
"db:ms": "npm run db:migrate && npm run db:seed",
"db:migrate": "sequelize-cli db:migrate",
"db:seed": "sequelize-cli db:seed:all --debug", The configuration-file is named // File: db/config.js
import { AuthTypes, Connector, IpAddressTypes } from '@google-cloud/cloud-sql-connector';
import dotenv from 'dotenv';
const config = dotenv.config();
// ... with require("@babel/register")
const path = require('path');
module.exports = {
'config': path.resolve('src', 'db', 'config.js'),
'models-path': path.resolve('src', 'db', 'entity'),
'migrations-path': path.resolve('src', 'db', 'migrations'),
'seeders-path': path.resolve('src', 'db', 'seeders'),
}; |
it works properly with just |
ERROR: Error reading "src/core/database/config.ts". Error: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/../src/core/database/config.ts
I'm trying to migrate db with npx sequelize-cli db:migrate command, but it throws the above exception.
My Config File: config.ts
module.exports = {
development: {
default: {
username: process.env.DB_USER,
password: process.env.DB_PASS,
database: process.env.DB_NAME_GLOBAL,
host: process.env.DB_HOST,
port: process.env.DB_PORT,
dialect: process.env.DB_DIALECT
},
transaction: {
username: process.env.DB_USER,
password: process.env.DB_PASS,
database: process.env.DB_NAME_TRANSACTION,
host: process.env.DB_HOST,
port: process.env.DB_PORT,
dialect: process.env.DB_DIALECT
}
},
};
__Dialect: postgres
__Database version: PostgreSQL 14.3
__Sequelize CLI version: Version 4.7.2
__Sequelize version: Sequelize CLI [Node: 14.18.1, CLI: 6.4.1, ORM: 6.20.0]
The text was updated successfully, but these errors were encountered: