Skip to content

Could not resolve "jquery" error with gradle build #405

@LukasLeppich

Description

@LukasLeppich

I get the following error with quarkus-web-bundler when I try to build with gradlew build

X  Could not resolve "jquery"

    web/app.js:14:14:
      14 Ôöé import $ from 'jquery'
         ÔòÁ               ~~~~~~~~

  You can mark the path "jquery" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.


> Task :quarkusAppPartsBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusAppPartsBuild'.
> There was a failure while executing work items
   > A failure occurred while executing io.quarkus.gradle.tasks.worker.BuildWorker
      > io.quarkus.builder.BuildException: Build failure: Build failed due to errors
                [error]: Build step io.quarkiverse.web.bundler.deployment.BundleProcessor#bundle threw an exception: io.mvnpm.esbuild.BundlingException: EsBuild Bundling failed
                at io.mvnpm.esbuild.deno.DenoRunner.scriptLog(DenoRunner.java:152)
                at io.mvnpm.esbuild.deno.DenoRunner.waitForExit(DenoRunner.java:96)
                at io.mvnpm.esbuild.deno.DenoRunner.runDenoScript(DenoRunner.java:50)
                at io.mvnpm.esbuild.script.BuildScript.build(BuildScript.java:41)
                at io.mvnpm.esbuild.script.ScriptRunner.build(ScriptRunner.java:32)
                at io.mvnpm.esbuild.Bundler.esBuild(Bundler.java:125)
                at io.mvnpm.esbuild.Bundler.bundle(Bundler.java:33)
                at io.quarkiverse.web.bundler.deployment.BundleProcessor.bundleAndProcess(BundleProcessor.java:68)
                at io.quarkiverse.web.bundler.deployment.BundleProcessor.bundle(BundleProcessor.java:58)
                at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
                at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:898)
                at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
                at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
                at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2651)
                at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2630)
                at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1622)
                at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1589)
                at java.base/java.lang.Thread.run(Thread.java:1583)
                at org.jboss.threads.JBossThread.run(JBossThread.java:501)


* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights from a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.

BUILD FAILED in 6s
8 actionable tasks: 2 executed, 6 up-to-date

Reproduce:

  1. Clone https://github.com/LukasLeppich/quarkus-web-bundler-resolve-bug
  2. Execute gradlew build

This is basically an empty project from https://code.quarkus.io/ with the Web Bundler extension, Java 21 and gradle.
This doesn't work out of the box, you have to manually add the id("io.mvnpm.gradle.plugin.native-java-plugin") version "1.0.0" plugin to the gradle build.
After adding this I was able to build the project with gradlew build.

In the next step I added the compileOnly 'org.mvnpm:jquery:3.7.1' dependency and uncomment the JQuery import in app.js import $ from 'jquery'. With this changes, the gradle build fails with the error from above.

Do I have to do something else for the gradle build to work?

Environment:
OS: Windows 11 Enterprise 10.0.26200 Build 26200
Java:

openjdk version "21.0.10" 2026-01-20 LTS
OpenJDK Runtime Environment Temurin-21.0.10+7 (build 21.0.10+7-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.10+7 (build 21.0.10+7-LTS, mixed mode, sharing)

Metadata

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