Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install flatpickr correctly on Laravel 10, vite. #72

Open
rhonautix opened this issue Apr 23, 2023 · 1 comment
Open

How to install flatpickr correctly on Laravel 10, vite. #72

rhonautix opened this issue Apr 23, 2023 · 1 comment

Comments

@rhonautix
Copy link

I'm getting Uncaught ReferenceError: flatpickr is not defined. I've already installed flatpickr using npn.

npm i flatpickr --save

I've added import flatpickr from 'flatpickr'; to my vite.config.js

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import flatpickr from 'flatpickr';

I'm not sure if this is the right way to install.

@lrljoe
Copy link
Member

lrljoe commented May 22, 2023

Apologies that I didn't see this sooner, are you still having issues?

You should be adding any additional NodeJS packages that are used throughout your project to your app.js file ideally.

If you're not running a VIte Dev server, or are in a production environment, make sure to run "npm run build" to generate the built files correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants