Closed NW-Lab closed 1 year ago
This is caused by a bug in mcconfig that is triggered in the plug-in build environment, which builds outside the Node-RED MCU repository. That's perfectly reasonable, but was overlooked. The fix is in mcmanifest.js
. Change this...
else if (nodeTypes[node.type])
this.parseManifest(source, {include: nodeTypes[node.type], directory: this.resolveVariable("$(NODEREDMCU)")});
To this:
else if (nodeTypes[node.type]) {
const save = this.currentDirectory;
this.currentDirectory = this.resolveVariable("$(NODEREDMCU)");
this.parseManifest(source, {include: nodeTypes[node.type], directory: this.currentDirectory});
this.currentDirectory = save;
}
...and then rebuild Moddable SDK tools.
There is a workaround, which may be a good idea for the near term. The workaround is to change $NODEREDMCU/node_types.json to use absolute paths. For example, replace this
"ui_button": "./nodes/dashboard/manifest.json",
...with this...
"ui_button": "$(NODEREDMCU)/nodes/dashboard/manifest.json",
...for all the relative paths.
I successfully tested that with the MCU plug-in. The advantage is that users only need to update their Node-RED MCU repository, not the Moddable SDK.
@ralphwetzel – your input here would be helpful before deciding whether to deploy the workaround. Thank you!
flows.forEach((node, i) => {
if (node.moddable_manifest)
this.parseManifest(source, {...node.moddable_manifest, directory: this.currentDirectory});
else if (nodeTypes[node.type])
this.parseManifest(source, {include: nodeTypes[node.type], directory: this.resolveVariable("$(NODEREDMCU)")});
});
looks like you're always magically including the manifests for nodes listed in node_types.json
- which I think is a quite clever change.
Consequentially - if you confirm - the plugin doesn't need to include the (path to the) manifests for those nodes anymore in the generated manifest.json
.
I could remove the few lines that handle this topic & release a new version - if this helps to solve the issue easier.
@phoddie san, @ralphwetzel san
Thank you for your response.
Thank you for telling me how to fix it. For the time being, I modified mcmanifest.js and it worked correctly.
Thanks,
@ralphwetzel – thanks for taking a look. You are correct -- I've been working towards having the build include the required node manifests, to only build the nodes used in given flow. I eventually realized that the node_types.json
database that Patrick added for you for the MCU plug-in could be used to resolve the built-in nodes.
I'll commit an update today to node_types.json
to use absolute paths temporarily to work around the mcconfig bug. In my testing, that works the MCU plug-in. If you can confirm that and then update the plug-in, that would be great.
@phoddie I've updated the plugin. It will no longer include the manifests for nodes in node_types.json
. Thus it's save to change this file now...
Thanks, @ralphwetzel. I've committed the change to node_types.json
.
I also committed a change that splits the MQTT nodes out of the core into a module. They rely on the magic include mechanism to build.
@phoddie san, @ralphwetzel san
I've verified that it works fine with a github clone.
thank you.
Hello It may be the same as the other day, but I can't find the dashboard manifest.json. File exists.
Windows (Same error on Ubuntu (WSL environment).
flows.json
manifest.json automatically generated by Node-RED MCU Plugin
thanks ,