在 nextjs 中实现实时网络通知推送器

问题描述

在 nextjs 应用程序上初始化 pusher 后出现以下错误

export { Client,RegistrationState,TokenProvider };
^^^^^^
SyntaxError: Unexpected token 'export'

我也尝试将 next.config.js 文件修改为以下内容

const withTM = require("next-transpile-modules")(["@pusher/push-notifications-web"])
module.exports = withTM({
  env: {
    apiBaseUrl: "",apiBaseUrlChat: ""
  },});

当我尝试执行 npm run dev 时,它给了我以下错误

TypeError: modules.map is not a function

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)