bootstrap-switch-button-react icon indicating copy to clipboard operation
bootstrap-switch-button-react copied to clipboard

NextJS integration problem

Open HarisPap11 opened this issue 4 years ago • 1 comments

Hello,

I'm trying to use this library in Next JS but I get the below error "Windows is not defined".

ReferenceError: window is not defined
    at r (C:\Users\papad\Desktop\harispap-xyz\node_modules\bootstrap-switch-button-react\lib\bootstrap-switch-button-react.js:1:9931)
    at s (C:\Users\papad\Desktop\harispap-xyz\node_modules\bootstrap-switch-button-react\lib\bootstrap-switch-button-react.js:1:10019)
    at t.exports (C:\Users\papad\Desktop\harispap-xyz\node_modules\bootstrap-switch-button-react\lib\bootstrap-switch-button-react.js:1:13054)
    at Object.<anonymous> (C:\Users\papad\Desktop\harispap-xyz\node_modules\bootstrap-switch-button-react\lib\bootstrap-switch-button-react.js:1:4427)
    at n (C:\Users\papad\Desktop\harispap-xyz\node_modules\bootstrap-switch-button-react\lib\bootstrap-switch-button-react.js:1:186)
    at Module.<anonymous> (C:\Users\papad\Desktop\harispap-xyz\node_modules\bootstrap-switch-button-react\lib\bootstrap-switch-button-react.js:1:1134)
    at n (C:\Users\papad\Desktop\harispap-xyz\node_modules\bootstrap-switch-button-react\lib\bootstrap-switch-button-react.js:1:186)
    at C:\Users\papad\Desktop\harispap-xyz\node_modules\bootstrap-switch-button-react\lib\bootstrap-switch-button-react.js:1:985
    at Object.<anonymous> (C:\Users\papad\Desktop\harispap-xyz\node_modules\bootstrap-switch-button-react\lib\bootstrap-switch-button-react.js:1:994)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)

HarisPap11 avatar Apr 07 '20 13:04 HarisPap11

I got the same error, is there any solution?

AbdulmelikKalkan avatar Dec 05 '20 17:12 AbdulmelikKalkan