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

Can not display node icon when npm package has scope. #1305

Closed
code2nguyen opened this Issue Jun 30, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@code2nguyen
Contributor

code2nguyen commented Jun 30, 2017

I updated node-red 0.17.0 and found this error:

I have a node of node-red and my npm package uses scope.... node-red ui can not display the icon of my node.

Example : package.json

{
   "name": "@my-scope/test-node",
   "version": "1.0.0"
   ...
}

then Node-Red editor will try to get my icon with URL : http://localhost:8080/icons/@my-scope/test-node/my-icon.png

It returns a 404 (Not Found) error.

So, i must do some hotfixes

  1. In node-red/red/api/index.js :
            editorApp.get("/icons/:module/:icon",ui.icon);
            // Add new API with scope
            editorApp.get("/icons/:scope/:module/:icon",ui.icon);
  1. In node-red/red/api/ui.js
        // var module = req.params.module; OLD code
        var scope = req.params.scope;
        var module = scope ? scope + '/' +  req.params.module : req.params.module;
@knolleary

This comment has been minimized.

Member

knolleary commented Jun 30, 2017

Good spot, thanks. Want to stick a pull request in with your fix? Not going to rush a 0.17.1 for this, but good to get the fix in.

@knolleary

This comment has been minimized.

Member

knolleary commented Jun 30, 2017

Closed by #1307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment