Skip to content

Unable to get 'export default' to work #1

Description

@dougreed

I have an issue with sequelize-typescript. I cannot duplicate the success in this example.

I create a table definition i.e.:

@table({tableName: "security.security_user"})
export default class User extends Model {
...

Then the 'default' doesn't really do anything, and it cannot resolve even the functions in the defined class at 'tsc' compile time. If I don't define 'default' I get the same thing. Your example does not use default and it works fine.

If I define:

@table({tableName: "security.security_user"})
export class User extends Model {
...

and don't set a default there, but define something like 'export default this.Model('User', User)' after I close the definition, then compile works, but at run time, it fails because 'this.Model' is nonsense.

Your example imports using import {Movie} from '../models/Movie', but My routes complain that I have no exported members. I can only import using import User from '../models/User', .. i.e. no braces.

I would appreciate any advice you can give.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions