I'm using NR on a Zigbee stick (who'd have thought!), the SMLight SMHUB Nano MG24. It wants to control installed software itself, and it looks like they've got a problem I should report. The intellisense syntax checking (edited as intellisense works) doesn't seem to be properly hooked up for msg, node, flow etc.
If I hover over the error it says "Cannot find name 'msg'", although if I deploy, the code runs fine. I can also insert // @ts-nocheck to sidestep the issue, but it would be nice to point them in the right direction regarding a fix.
Since you state intellisense is working, I suspect the Node-RED specific types (and possibly more) are missing from the file system or not being served.
Can you open the developer tools on your browser, switch to the Network tab, and refresh your page? Then open a function node. Look out for 404 errors in the network requests.
Yeah I should have thought of that myself. I get errors when the page is refreshed, although no more errors when the function node is opened.
I searched for one of them (func.d.ts) on my normal docker NR install and found it. So then I tried on the SMHUB, also looking for a more obvious file (red.js). It found red.js but not func.d.ts, so I'm guessing they're not deploying all the required files.
root@SMHUB-1:/home/smlight/.node-red# find / -name "red.js"
/mnt/user/opt/nodered/red.js
/mnt/user/opt/nodered/node_modules/@node-red/editor-client/public/red/red.js
/mnt/user/opt/nodered/lib/red.js
/opt/nodered/red.js
/opt/nodered/node_modules/@node-red/editor-client/public/red/red.js
/opt/nodered/lib/red.js
root@SMHUB-1:/home/smlight/.node-red# find / -name "func.d.ts"
root@SMHUB-1:/home/smlight/.node-red#
Anyway, it's probably enough info to send them - thanks.
Your find points straight at the packaging: the Monaco func.d.ts and related editor-client type files are editor-only assets, so a missing func.d.ts while red.js is present means the SMLight build did not ship the full @node-red/editor-client public files. Worth reporting to SMLight with your two find outputs and the 404 list from the Network tab. At runtime it changes nothing — the flow still deploys because types are only used by the function-node editor — so // @ts-nocheck is a reasonable local workaround until they fix the package.