React JS Server side issue - window not found

后端 未结 7 1644
耶瑟儿~
耶瑟儿~ 2020-12-03 06:59

Hi I\'m trying to use react-rte in my reactJS project. I have server side rendering and every time I want to use this package I get:

return /msie [6-9]\\b/.         


        
7条回答
  •  失恋的感觉
    2020-12-03 07:52

    I've been using ReactJS.NET targeting build to client and server, and got the same problem.

    The solution is to set output.globalObject to 'this'.

    module.exports = {
      // ...
      output: {
        // ...
        globalObject: 'this'
      }
    };
    

    Without that option set, it's falling back to window which is working on client-only code.

提交回复
热议问题