You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReferenceError: document is not defined at K (C:\...\vue_src\node_modules\bootstrap\dist\js\bootstrap.min.js:6:8846) at C:\...\vue_src\node_modules\bootstrap\dist\js\bootstrap.min.js:6:9655 at C:\...\vue_src\node_modules\bootstrap\dist\js\bootstrap.min.js:6:84 at Object.<anonymous> (C:\...\vue_src\node_modules\bootstrap\dist\js\bootstrap.min.js:6:256)
I got around it by dynamically importing bootstrap only in browser like this, in main.ts:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was getting this error with production build:
ReferenceError: document is not defined at K (C:\...\vue_src\node_modules\bootstrap\dist\js\bootstrap.min.js:6:8846) at C:\...\vue_src\node_modules\bootstrap\dist\js\bootstrap.min.js:6:9655 at C:\...\vue_src\node_modules\bootstrap\dist\js\bootstrap.min.js:6:84 at Object.<anonymous> (C:\...\vue_src\node_modules\bootstrap\dist\js\bootstrap.min.js:6:256)
I got around it by dynamically importing bootstrap only in browser like this, in main.ts:
`const isBrowser = typeof window !== 'undefined'
if (isBrowser) {
await import ('bootstrap/dist/css/bootstrap.min.css')
await import ('bootstrap/dist/js/bootstrap.min.js')
await import ('@progress/kendo-theme-bootstrap/dist/all.css')
}
`
That let me successfully build but Bootstrap isn't loading. Any suggestions on what to look at?
Thanks so much!
Beta Was this translation helpful? Give feedback.
All reactions