-
-
Notifications
You must be signed in to change notification settings - Fork 604
-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
In electron: jquery.fancytree-all-deps.min.js fails to load with require() #796
Comments
I will come back with small demo of this issue. |
Yes, a demo would help. const fancytree = require('jquery.fancytree');
require('jquery.fancytree/dist/modules/jquery.fancytree.edit');
require('jquery.fancytree/dist/modules/jquery.fancytree.filter'); |
Hi, I added that issue as a standalone ticket, as I figured it might be a different issue than the other require() reported problems. I will produce a demo of this shortly. I need to re-make it work on Linux and show the problem on Mac. Thx for your quick answer, it is well appreciated. |
Update: In summary: works on Linux&Mac but with a twist: I rewrite the node_modules/jquery.fancytree content with your development github project. |
I finally got more information. It seems to be an incompatibility between v2.24.0 and v2.26.0. In my use case,
To reproduce the problem, you can use the same repo (https://github.com/allavoie/fancytree_issue), but switch to branch "make_fancytree_work_with_npm_install", and looking at the README file of that same branch, you will find the procedure to reproduce the issue. As an extract, here is the common code between these branches:
The following generates an exception (module not found) on v2.26.0, even thought the file exist in the node_modules package. To view the problem, you can switch the versions in the package.json and view the problem by running: npm update && npm run webapp. Is there something else you wish me to attempt ? |
With 2.26 you should not need to explicitly include jQuery UI anymore. Also jquery.fancytree-all-deps.min is not needed (which also already contains the needed jQuery UI components) Instead use the single modules directly from the dist/modules folder, e.g. const fancytree = require('jquery.fancytree');
require('jquery.fancytree/dist/modules/jquery.fancytree.edit');
require('jquery.fancytree/dist/modules/jquery.fancytree.filter'); (The core module See also https://github.com/mar10/fancytree/wiki#use-a-module-loader That's the idea anyway. I am curious to hear if it works for you. |
Hi, I tried your suggestions, and read your documentation. Any other hints ? |
@mar10: Having some problems with my environments on my repo... Cannot reproduce my scenarios... Will solve this and test your solution soon |
@mar10: Ok, could reproduce the problem, I cleared my npm cache, re-git-clone my repo (in master),
So I figured you must have a build process to generate this .min.js and applying your fix might not be enough for my use case. I will stick on v2.24.0 for now and wait for your next release, checking if my use case is covered. |
Hi @allavoie if you want to update and it still doesn't run please let me know. I could set up a demo based on your sample and try to get it to work. |
I would be interested in seeing >2.24.0 work with Electron (particularly for the fontawesome skins) |
@PeterAJansen I am interested in that too. Do you have a non-working sample that you could share? |
Starting with the electron sample, I added this changes, that seem to work.
"dependencies": {
"jquery.fancytree": "^2.30.0"
}
const fancytree = require('jquery.fancytree')
require('jquery.fancytree/dist/modules/jquery.fancytree.filter')
const tree = fancytree.createTree('#tree', {
extensions: ['filter'],
source: [
{title: 'node1'},
{title: 'node2', folder: true, children: [
{title: 'sub1'},
]},
],
});
tree.expandAll()
tree.applyFilter("1")
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link href="./node_modules/jquery.fancytree/dist/skin-win8/ui.fancytree.min.css" rel="stylesheet">
</head>
<body>
<h1>Hello World!</h1>
<div id='tree'></div>
<script>
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html> |
Hi, using the nodejs electron app framework, I experience the same problem.
I was first using fancytree-all-deps within a linux dev environment,
and it worked, by doing require() on (in that order)
jquery,
jquery-ui
and then jquery.fancytree.
I now moved my dev environment on a Mac, but I cannot load jquery.fancytree-all-deps (or jquery.fancytree-all) anymore.
When doing a require('...jquery.fancytree-all'), the package is found, but an exception:
Uncaught Error: Cannot find module 'jquery.fancytree.ui-deps'
is thown.
How to get around this exception ?
Is there a description somewhere of what should be the abstract all sequence of action to respect.
How should I proceed to propose a solution, can you provide hints, I can troubleshoot the problem, and try to propose a solution. For now, I try to add some changes to the jquery.fancytree-all-deps.js file but its to attempt to load itself. I could extract the minimal use case if needed.
Thx in advance.
The text was updated successfully, but these errors were encountered: