Hello,
I've got some questions on the Wiki wrt to this topic
(Node Red : 2.0.5)
(UiBuilder : 4.1.1)
(copy-webpack-plugin@9.0.1)
https://github.com/TotallyInformation/node-red-contrib-uibuilder/wiki/Using-VueJS-with-Webpack
When following the wiki step-by-step , the following changes had to be made :
- webpack.config.dev.js format has changed a bit with the latest versions of webpack-copy-plugin .
plugins: [
new VueLoaderPlugin(),
// Copies from wherever to the dist folder
new CopyWebpackPlugin({
patterns: [
{from: './src/index.html'},
{from: './src/index.css'},
{from: './src/manifest.json'},
]
}),
],
- index.js file
- uibuilder location has changed from "nodes" to "front-end" .
import uibuilder from './../../../node_modules/node-red-contrib-uibuilder/front-end/src/uibuilderfe.js'
3a) index.html file
The socket.io.js as mentioned is not found.
<script src="/uibuilder/socket.io/socket.io.js"></script>
What works is (this is now default in the default index.html as well)
<script src="../uibuilder/vendor/socket.io/socket.io.js"></script>
3b) manifest.json not found when building with npm run build.
Solution is to copy a manifest.json file from another uibuilder node (standard template).
3c) changed the uibuilder node in node-red editor , changing template to dist (otherwise the main.js file is not copied to the dist folder, which is needed as the index.html refers to it as "./main.js"
4)Question .
There does not seem to be a uibuilder.start() ?
So, after running npm run build in a terminal (.node-red/uibuilder/uitest) , I get the webpage, no errors in the console, however messages not received over socket.io
=> If I enter a uibuilder.start(this)
or uibuilder.start()
statement in index.js in the created: function() {}
hook, I get repeated Bad Request errors.
=> If I enter uibuilder.start('/uitest','../uibuilder/vendor/socket.io')
, I get no bad request errors but timeout messages in the console log repeatedly
[uibuilderfe:checkConnect:setTimeout] Socket.IO reconnection attempt. Current delay: 2000
Instance details in node red editor show no abnormality