Skip to content

JavaScript files are not working in Grails 4.0.1 and assets-pipline 3.0.11 from other directories or custom directories. #395

Open
@Mujadid-Ali

Description

i am facing a strange issue. in grails 4.0.1
i have a javaScript file in my grails-app/assets/javascript directory which name is progress-spinner.js and their code is

//= require js/progressSpinner

basically it is pointing out another file that have actual javascript code named progressSpinner.js in directory grails-app/assets/lib/js/.
i have included that file in my gsp gape as

<asset:javascript src="progress-spinner.js"/>

but when i run the app and open the page the code does not execute. i have checked by browser inspect code option the both file are loaded as

<script type="text/javascript" src="/assets/js/progressSpinner.js?compile=false"></script>
<script type="text/javascript" src="/assets/progress-spinner.js?compile=false"></script>

in the middle of page. and it does not have any error.
the problem is that code from the file is not working when i click on the button.
i have also place my file direct in grails-app/assets/javascript folder and try to include in but code does not work. also i have tried to include in my application.groovy like this

grails.assets.includes = [
    "js/progressSpinner.js"
]

but it also does not work.
i am using grails 4.0.1, jdk 11.0.5 and asset-pipeline-grails:3.0.11.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions