最重要的Redux:浏览器用法:错误:在构建应用程序上运行

时间:2019-02-24 19:57:36

标签: mattermost

我正在尝试为退出网站创建版本。 我已按照git repo提供的说明进行操作 browser-usage

但是当我尝试启动构建文件时,它给出错误消息为

enter image description here

请查看html文件代码:

<script src="polyfill.js"></script>
<script src="mattermost.client4.js"></script>
<script src="mattermost.websocket.js"></script>
<script type="text/javascript">
    const client = Mattermost.client4.default();
    const wsClient = Mattermost.websocket.default;
    var token;
    client.setUrl('https://your-mattermost-url.com');
    /* use an existing personal access token */
    client.setToken('yourToken');
    client.setIncludeCookies(false);
    /* login and obtain a token */
    client.login(username, password)
    .then(function(user){
        console.log(`Logged in as ${user.email}`);
        token = client.getToken();
    })
    .then(function(){
        wsClient.initialize(token, {}, {}, {connectionUrl: 'wss://your-mattermost-url.com/api/v4/websocket'});
    })
    .catch(function(err){
        console.error(err);
    });
</script>

0 个答案:

没有答案