Skip to content

typeof一个模块都是undefined,new构造函数提示not defined #53

Description

@bravelincy

模块lib/socket-connection.js

module.exports = function SocketConnection () {}

引入:

import { SocketConnection } from 'xxx'

console.log(typeof SocketConnection) // undefined
console.log(SocketConnection) // function SocketConnection () {}

SocketConnection() // 正常执行函数
new SocketConnection() // Uncaught ReferenceError: SocketConnection is not defined

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions