flowbite-datepicker
flowbite-datepicker copied to clipboard
SyntaxError: Cannot use import statement outside a module
Hi,
im trying to import the datepicker in nextjs and im getting this error.
SyntaxError: Cannot use import statement outside a module
Same issue here
Same issue in Rails 7. I think it's because package.json needs a "type": "module" statement.
I was able to make it work using Flowbite's CDN but it's a bit of a hack, because it's not instantiating Datepicker when I want it to.
Same issue here.
I've tried to manually modify package.json with a "type": "module" however it's not working.
Same issue 👍🏻
(node:20352) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use node --trace-warnings ... to show where the warning was created)
C:\secret_path\node_modules\flowbite-datepicker\js\Datepicker.js:1
import {lastItemOf, stringToArray, isInRange} from './lib/utils.js';
Please make @type or resolve this !
Any update on this? This is causing some build issues and would love to use the date picker.
Really would like to see this fixed. Very annoying problem, and sad to see the Flowbite team isn't responding to this problem.
Unfortunately afaik there are no typescript definitions. You could try to solve your problem by creating a type definition file next to your date picker component.
// picker.d.ts
declare module 'flowbite-datepicker/Datepicker';
This wouldn't bring you types but at least it makes the compiler happier
got same issue in my project