Node-webkit require is undefined - node-webkit

I'm trying to run the server version of TW5 as a node-webkit app. I followed the good instructions stated here: https://groups.google.com/d/msg/tiddlywiki/WRnhjD6LUPQ/Zmikdvo0QA0J
to run those files in node-webkit, the code you need is here: https://gist.github.com/Arlen22/d7ad0b6a108fa3cedf72
Open that link and copy index.htm and nodewebkit.js into the root of the tiddlywiki folder.
Open package.json, and copy the two objects in the gist's package.json into it.
Package.json already has a "main" object farther down which you will need to remove.
Drag the entire tiddlywiki folder onto the node-webkit executable.
When I do the last step I got the following errors on the Developer tools console of node-webkit:
Uncaught ReferenceError: require is not defined
Not allowed to load local resource: file:///C:/Users/.../node-webkit/TW5/index.htm data:text/html,chro…:1
The weird thing is: if I remove the index.html from the addres bar, then the TW5 folder is listed, and clicking on the index.html open the application as expected, working flawlessly. Could someone tell me where is the problem?
Thanks in advance.

The problem was at package.json. This is kind dumb, but I wrote index.htm instead of index.html. So if you are getting Not allowed to load local resource: error be sure to check your package.json for bad names.
Regards

Related

EAS building fails with package.json error

Using Managed workflow
Your eas-cli version
eas-cli/2.7.0
win32-x64
node-v16.10.0
What you have tried so far
Clicked through every link on Google I could find (none mentioned this error specifically)
Read the Expo Documentation as well as Troubleshooting Guide
Ensured that the package.json is in the root directory
Error: package.json does not exist in /Users/expo/workingdir/build
I am building for iOS and having no issues up to the ‘Prepare Project’ phase. Each subsequent fails with the same error.
I have no idea where the ‘/Users/expo/workingdir/build’ directory actually is, as I don’t have an ‘expo’ user on my machine. Do I need to create these directories?
I don't post here so let me know if I need to add anything else.

GSAP fails to import

I am trying to include gsap into a JavaScript file and even it being very straight forward it will not load. I am using what GreenSock docs say to do and still no luck. I have added "type": "module" in the json file and the script file I am import into. In my HTML has type="module included and I have a class module already imported into it. It is working fine.
After doing a npm install gsap and it is in my .json file "gsap": "^3.11.0"
They say include this at the very top of the file using it: import {gsap} from "gsap"
Doing so only throws a console error:
Uncaught TypeError: Failed to resolve module specifier "gsap". Relative references must start with either "/", "./", or "../".
I didn't include any of those being it is a npm install not a cdn script, then on a whim I did try to include any one of those and still nothing. But the error now reads:
GET ###url####ERR_ABORTED 404 (Not Found) looking for a file in my directory. With npm install there is no file just a node_module.
Will just go to the cdn version but just wondering why this is a problem? I am using a tutorial and even the npm isntall steps he uses worked. But when I try it fails .... included image and with or with a " ./ " director included nothing loads
If anyone has any advice feel free to include it here. Removed via npm remove gsap and included the cdn in my html. It is 2022 and shouldn't have to be this hard .....
I just needed to put the cdn in the html and gsap worked perfectly in the js file
CDN - <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/gsap.min.js"></script>

relative path in chrome polymer 3 IIS

I updated my project from Polymer-2.x to Polymer-3.x and now, when I just open my index,html in my browser I get 'Uncaught TypeError: Failed to resolve module specifier "#polymer/polymer/polymer-element.js". Relative references must start with either "/", "./", or "../".'
I enabled the relative path support in chrome but it still does not work.
With polymer serve it works fine, but I need it to work via IIS because it refers its url in its code and I have routing to do with it. So localhost is not an option for me.
Is there a way, so I can get it work without polymer serve?
As far as I know, the polymer serve-command replaces npm-paths (e.g. #polymer/polymer/polymer-element.js) with relative paths (e.g. ../node_modules/#polymer/polymer/polymer-element.js) to serve these files. So without that command, your browser does not know where the files are located.
To build a polymer project for production the polymer-cli has a command called polymer build to replace these paths automatically and that should solve your problem. Additionally that helpful command may bundle the project and minify your files. Just have a look at the documentation
Alternatively you could just replace them manually with relative paths.

Getting jQuery Error on using ezzeelfinder

Hi I am trying to use ezzeelfinder as file manager
I am getting the following error:
TypeError: jQuery(selector).elfinder is not a function
Query(selector).elfinder().elfinder("instance");
I am using the exact code from the Yii extension website. I do not know what is going wrong, I am using windows 7 with Apache (XAMPP)?
Continuing our discussion from previous ElFinder question let me try to explain more.
Can you look at what is inside elfinder.min.js file included from assets directory (you can use Firebug: Net tab > expand request of /assets/abcdef/elfinder.min.js > Response tab)? It wasn't a script (but some HTML with error) when I've reproduced a problem with such error. So if this JavaScript file is not included then there is no elfinder method extending jQuery and the error message you receive is fair.
Seems to me that this one is a permission issue. elfinder.min.js file cannot be published to assets directory for some reasons. Make sure that all permissions to elfinder.min.js file WITHIN extension's directory are granted. After granting the permissions to this file clean up assets directory and try again. At last, check whether the script has been really published to assets directory and has granted permissions there.
I don't know whether it will be helpful for you but I have an archive with demo files that can demonstrate extension's basic usage (made under Ubuntu though): http://ezze.org/yii/ezzeelfinderdemo.zip
Extract the contents of this archive to the root folder of Yii basic application created from command line using yiic script.

Apache Installation

I just installed Apache 2.2.x in my windows 7 x64. everything seemed okey and I am getting the "It works!" page. However when I tried to edit the index.html in htdocs and I display localhost again it just says "It works!" it didnt show the modifications that I did on the file. Is this an indication of something wrong with my installation?
I believe to change the index.html in win7x64 , you need to run your editor as an administrator , as it is located in program files folder , and to change anything in program files folder or any folder under it you need to run the editor as admin
Double check that your browser isn't caching the default page. After you make a change to your index.html, clear your browser cache and try again.
If that still doesn't work, ensure you're not editing the wrong index.html file; the default site may be pointing to a different location than the one you're editing. (I'd guess the issue is the browser cache, however...)
Ctrl-F5 the page for hard refresh.
If same page is there:
A) you're editing the wrong index.html/php file.
B) you're making edits that don't change the output.
If you can't get it to work, I suggest you install a full WAMP package.