Cannot find module when using 2 different schemas with 2 different folders
See original GitHub issueI’m not sure if related to https://github.com/kristiandupont/kanel/issues/15 , but feel free to close this one if it is.
init-db.sql
CREATE SCHEMA test1;
CREATE SCHEMA test2;
CREATE TABLE test1.users (
id integer DEFAULT nextval('test1.users_id_seq'::regclass) PRIMARY KEY
);
CREATE TABLE test2.user_managers (
id integer DEFAULT nextval('test2.user_managers_id_seq'::regclass) PRIMARY KEY,
user_id integer REFERENCES test1.users(id)
);
So basically just 2 schemas with the other one pointing to other one.
.kanelrc.js
const path = require("path");
module.exports = {
// connection: {},
filenameCasing: "dash",
typeCasing: "pascal",
preDeleteModelFolder: true,
schemas: [
{
name: "test1",
modelFolder: path.join(__dirname, "models", "test1"),
},
{
name: "test2",
modelFolder: path.join(__dirname, "models", "test2"),
},
],
};
Output: ./models/test2/user-managers.ts
// Automatically generated. Don't change this file manually.
import { UsersId } from './users'; // <-- ERROR HERE! Refers to same folder, even though the UsersId is in "test1".
export type UserManagersId = number & { __flavor?: 'user_managers' };
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Node JS cannot find module error for file in another folder
var schemas = require('./folder/schema');. i get an error Cannot find module whats happening? Edit1 : I got rid of the error by using...
Read more >Nuxt project info - GitHub
nuxt.config.md Error: Cannot find module '../../packages/schema/schema/config.schema.json' Require stack: - C:\Users\vidar\Projekte\Developement ...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >jsconfig.json Reference - Visual Studio Code
js doesn't reference a file b.ts explicitly (either using import or CommonJS modules), there is no common project context between the two files....
Read more >Cannot find a database object in Database Explorer - JetBrains
Step 1. Refresh the database state · Step 2. Verify that the necessary schemas are selected · Step 3. Force refresh schema information...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should finally be addressed 😃
There is a premajor version out that should fix this issue. There are significant breaking changes though, and the API is not final so feel free to experiment if you like. The documentation is work in progress still, you can start here: https://github.com/kristiandupont/kanel/blob/v3/docs/configuring.md
Sorry, I guess this problem remains. I am doing some updates these days, so I will try and see if I can look into this as well.