Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 节点模块(@pusher/push notifications web)无法在刷新页面上导入-nextjs_Javascript_Node.js_Reactjs_Next.js_Pusher - Fatal编程技术网

Javascript 节点模块(@pusher/push notifications web)无法在刷新页面上导入-nextjs

Javascript 节点模块(@pusher/push notifications web)无法在刷新页面上导入-nextjs,javascript,node.js,reactjs,next.js,pusher,Javascript,Node.js,Reactjs,Next.js,Pusher,在集成节点模块时面临此问题@pusher/push notifications web 我不确定这是NextJs还是节点模块本身的问题 当页面第一次加载时,一切正常,但如果我们刷新页面或将用户重定向到新页面,则一切正常。我得到了这个错误 可以通过使用next.js配置中的next transfile modules传输@pusher/push notifications web模块(导出为ESM)来解决此问题: //next.config.js const with tm=require('n

在集成节点模块时面临此问题
@pusher/push notifications web

我不确定这是NextJs还是节点模块本身的问题

当页面第一次加载时,一切正常,但如果我们刷新页面或将用户重定向到新页面,则一切正常。我得到了这个错误


可以通过使用next.js配置中的
next transfile modules
传输
@pusher/push notifications web
模块(导出为ESM)来解决此问题:

//next.config.js
const with tm=require('next-transfile-modules')(['@pusher/push-notifications-web']);
module.exports=withTM({/*自定义配置*/});