Skip to content

JQuery/ui undefined when using Angular's Vite Builder #1180

@joshf67

Description

@joshf67

Description:

With the ability of supporting Node/CommonJS, Fancytree can use require("jquery"), however, Jquery-ui does not support the functionality.

So I ran into the issue of Fancytree using it's local version of jquery-ui and expecting jquery to be in the window, whilst also importing jquery and expecting it to be the same instance.

A solution to this was to import jquery in my entry file and then assign window.jQuery and then dynamic import the app to allow jQuery to be set up before continuing

Issue:

Fancytree requires jquery-ui then jquery, but jquery-ui relies on window.jQuery

Potential fix?:

Arrange the code below to require jquery first, then require jquery.fancytree.ui-deps, then return

} else if (typeof module === "object" && module.exports) {
// Node/CommonJS
require("./jquery.fancytree.ui-deps");
module.exports = factory(require("jquery"));

Caveat:
This very well could be due to how I have laid out the application, a bug with Angular's builder or a bug with Fancytree's importing order, but it does seem to me that there's a fix possible in Fancytree

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions