This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Preline JS Bundle not working #49
Comments
Can you add some code for reference ? |
{{> title}} {{> tailwind-css}} {{!-- --}} {{{ body }}} <script src='/js/preline.js'></script> <script src='/js/test.js'></script> |
This is a handlebars layout code. Including the preline js file at the end of the body tag. |
Using this, can you confirm there is an error in the console in the browser ?
|
Nope, there is no error in the browser.
The file loads correctly, but the js functionality is not working. For
example, js related events such as dropdown, banner close, accordion etc.
are not working.
I also loaded a simple console.log script in another js file to ensure js
is working fine on the frontend. The test console.log script works fine.
Regards,
Ankur
…On Mon, Feb 20, 2023 at 4:14 PM Koussay ***@***.***> wrote:
Using this, can you confirm there is an error in the console in the
browser ?
{{> title}} {{> tailwind-css}} {{!-- --}} {{{ body }}} <script
src='/js/preline.js'></script> <script src='/js/test.js'></script>
—
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFOYL5NTNTTVYDVIDKBRBKDWYNDKRANCNFSM6AAAAAAU6GUSFM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Because if the all of the JS functionalities are not working, that means the JS file is not loaded.
|
Kindly guide how should I load the js file correctly in the handlebars
template :-)
I don't see any error in the console on the front end.
Because except for preline.js all other js files are getting loaded
correctly.
…On Mon, Feb 20, 2023 at 6:02 PM Koussay ***@***.***> wrote:
Because if the all of the JS functionalities are not working, that means
the JS file is not loaded.
However, according to the documentation, if you installed the library via
npm,
the preline.js file should be loaded from node_modules, as follows
<script src="./node_modules/preline/dist/preline.js"></script>
—
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFOYL5LW2NBRYTZYL7Z3COTWYNP6JANCNFSM6AAAAAAU6GUSFM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@ankurdhamija83 You can load the js file like @koossaayy said. Please note that it depends where your preline js location. |
Hello Jessie,
Thanks for your reply.
Sorry, but I am unable to load the file correctly from node_modules
directory in my application views.
I copied the preline.js file from node_modules/dist/preline.js and copied
it to public/js/preline.js. In the handlebars view, it is loaded as <script
src='/js/preline.js'></script>
On the frontend, I don't get any error message for preline.js but the
script doesn't work.
Kindly suggest, how should I load the file directly from node_modules and
serve it on the frontend.
Thank you
…On Tue, Feb 21, 2023 at 8:54 PM Jessie A. Azupardo ***@***.***> wrote:
@ankurdhamija83 <https://github.com/ankurdhamija83> You can load the js
file like @koossaayy <https://github.com/koossaayy> said. Please note
that it depends where your preline js location.
—
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFOYL5PPSFIXWTDGHU3JRPDWYTMZPANCNFSM6AAAAAAU6GUSFM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Screenshot for your reference.
Thanks & Regards
On Tue, Feb 21, 2023 at 9:36 PM Ankur Dhamija ***@***.***>
wrote:
… Hello Jessie,
Thanks for your reply.
Sorry, but I am unable to load the file correctly from node_modules
directory in my application views.
I copied the preline.js file from node_modules/dist/preline.js and copied
it to public/js/preline.js. In the handlebars view, it is loaded as <script
src='/js/preline.js'></script>
On the frontend, I don't get any error message for preline.js but the
script doesn't work.
Kindly suggest, how should I load the file directly from node_modules and
serve it on the frontend.
Thank you
On Tue, Feb 21, 2023 at 8:54 PM Jessie A. Azupardo <
***@***.***> wrote:
> @ankurdhamija83 <https://github.com/ankurdhamija83> You can load the js
> file like @koossaayy <https://github.com/koossaayy> said. Please note
> that it depends where your preline js location.
>
> —
> Reply to this email directly, view it on GitHub
> <#49 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFOYL5PPSFIXWTDGHU3JRPDWYTMZPANCNFSM6AAAAAAU6GUSFM>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
The integration process you're doing is wrong. |
Hi,
I have installed it via npm and require the plugin in the config file of
Tailwind.
The part I am missing is what should be the location of preline.js file?
I am unable to call it from the node_modules folder. Is it possible for you
to share a boilerplate express server setup with preline.js installed
correctly.
<script src="./assets/vendor/preline/dist/preline.js"></script>
I don't see the above mentioned path anywhere in my application.
Regards,
Ankur
…On Tue, Feb 21, 2023 at 11:28 PM Koussay ***@***.***> wrote:
Hello Jessie,
Thanks for your reply.
Sorry, but I am unable to load the file correctly from node_modules
directory in my application views.
I copied the preline.js file from node_modules/dist/preline.js and copied
it to public/js/preline.js. In the handlebars view, it is loaded as
<script src='/js/preline.js'></script>
On the frontend, I don't get any error message for preline.js but the
script doesn't work.
Kindly suggest, how should I load the file directly from node_modules and
serve it on the frontend.
Thank you
On Tue, Feb 21, 2023 at 8:54 PM Jessie A. Azupardo *@*.***>
wrote:
@ankurdhamija83 <https://github.com/ankurdhamija83>
https://github.com/ankurdhamija83 You can load the js
file like @koossaayy <https://github.com/koossaayy>
https://github.com/koossaayy said. Please note
that it depends where your preline js location.
—
Reply to this email directly, view it on GitHub
#49 (comment)
<#49 (comment)>
,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFOYL5PPSFIXWTDGHU3JRPDWYTMZPANCNFSM6AAAAAAU6GUSFM
.
You are receiving this because you were mentioned.Message ID:
*@*.***>
The integration process you're doing is wrong.
The file preline.js is set to call other components, i.e : Modal,
Dropdown, etc...
So copying just the file, won't work. That's why you need to install it
via NPM, and require the plugin in the config file of Tailwind.
—
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFOYL5LZXLX2XS2X4R33MSDWYT633ANCNFSM6AAAAAAU6GUSFM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi, I think you are getting 404 in your preline.js. Move this "preline" folder inside your public folder which you can load it in your project. Example : |
I have solved this problem by removing important param in talwind.config.js. Hope it will help someone. |
What did you removed? |
@ankurdhamija83 Hi, |
@azupardo |
Hey folks! Thanks everyone for the input - I am converting this issue into Discussions. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hi All,
Thanks for creating this amazing library.
I am facing issue with the js bundle.
The components are loading correctly on the webpage but the js functionality is not working. I followed the instructions to load the preline js file on the page, however, there seems to be some issue. Dropdown, banners and other components which require js functionality are not working.
Kindly help.
The text was updated successfully, but these errors were encountered: