Skip to content
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

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

Open
bravelincy opened this issue Jul 19, 2019 · 0 comments
Open

Comments

@bravelincy
Copy link

bravelincy commented Jul 19, 2019

模块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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant