Can not debug locally

Guys i cloned the repo and it runs fine using grunt dev and i can visit it on localhost:1880 , but when i make any type of changes they dont apply, i cleared my caches and localStorage, i even deleted all content in node-red/packages/node_modules/@node-red/editor-client/src/js/red.js and grunt still runs fine and everything is working, I do i get to test locally?

Hi @Lavhe

I did reply on slack, but as you've asked here as well, I'll reply here.

In theory, all you need to do is pretty much what you've done:

  1. git clone the repo
  2. run grunt dev - this will build the code, run it and watch for changes in the code. If you modify any runtime code it automatically restart it, if you modify the editor it rebuilds its code.

If you're modifying the editor code (which from the context in the slack post, you are), then the built editor code is in: packages/node_modules/@node-red/editor-client/public/red/red.js - note this is not the file you say you have deleted. If you really have deleted the red.js in the src part of the tree, you have deleted src code needed by the editor and you'll want to restore it.

I suggest you manually modify packages/node_modules/@node-red/editor-client/public/red/red.js, add a console.log in there and reload the editor in your browser to see if it is picked up.

For completeness, for the thing you are trying to do, an alternative will be to use the editorTheme option in settings.js to insert a custom script into the page.

https://nodered.org/docs/user-guide/runtime/configuration#editor-themes

editorTheme: {
    page: {
        scripts: [ "/absolute/path/to/custom/script/file"]
    }
}

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.