Module not found: Error: Can't resolve 'net' in 'node_modules/stompjs/lib'

前端 未结 6 1273
夕颜
夕颜 2021-02-18 20:38

Got an issue where a stompJS-lib was not found, upon which I got the following error message:

Module not found: Error: Can\'t resolve \'net\' in \'/../../../.../         


        
6条回答
  •  不思量自难忘°
    2021-02-18 21:31

    To avoid installing random packages, you could add this into your Webpack configuration.

    node: {
      net: 'empty',
    },
    

    The issue is caused by expecting the net package which is a package from Node.JS and does not exist in the browser.

    If you want more information and explanations you can find it here.

提交回复
热议问题