bulma-calendar
bulma-calendar copied to clipboard
Navigator not defined when bundling with webpack
Your issue may already be reported! Please search on the issue track before creating one.
- [X] Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
- [X] Are you running the latest version?
- [X] Are you reporting to the correct repository?
Bug Report
Environment
- Extension version(s): v6.0.7
- Bulma version: v0.7.0
- OS: macOS 10.14.5
- Browser: all
- How you are customizing the extension: no, just using the default one
Current Behavior Error prompt when building with webpack
//src/js/defaultOptions.js
lang: navigator.language.substring(0, 2) || 'en', // internationalization
Possible Solution Remove the navigator in the DefaultOptions or put the if statement to it when it is null.
Additional context/Screenshots
Add any other context about the problem here.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codepen or similar. None
@Wikiki .. having this same issue also.
using NuxtJS.
any updates?
Same problem here with NextJS. I suppose this must fail with SSR-Frameworks since there is no navigator object on the server side. I would suggest to incorporate the bugfix of @richardtks to circumvent the issue.
Same problem here with NextJS. I suppose this must fail with SSR-Frameworks since there is no navigator object on the server side. I would suggest to incorporate the bugfix of @richardtks to circumvent the issue.
Same situation here. If you have another pretty solution, I would appreciate it.
Try:
export default {
components: {
bulmaCalendar: process.client ? import('bulma-calendar').bulmaCalendar : { }
}
}
For nextJS use dynamic imports and ssr:false.
const InvoiceForm = dynamic(
() => import('../components/invoices/InvoiceForm'),
{ ssr: false }
);