Open harsh2304 opened 2 years ago
@NathanaelA : Can you please help me here? Let me know in case you require more details regarding error. Thank you so much in advance.
Have you downloaded the demo and seen if it builds properly?
@NathanaelA : Thank you for your response. Can you please provide me the link for demo?
Its the demo in this repo. Clone the repo, and then try it.
Hi @NathanaelA ,
I am facing the same issue after upgrading. As you suggested I took the demo to check if it is working but it failed with the following:
Preparing project... [webpack-cli] Error: Unknown option '--env.hmr' [webpack-cli] Run 'webpack --help' to see available commands and options Executing webpack failed with exit code 2.
I realised that you require ns8 for the demo to work. I am currently using ns7.
Any suggestions on how to fix this.
Thanks
Just upgrade your nativescript cli. (npm i -g nativescript@latest
) The most current NS CLI will build NS 6, 7 & 8 projects.
Yes you were right, thanks for the help.
Hi @NathanaelA, I am facing the same issue described in the main issue. I am using "6.4.0" nativescript core version and 6.5.0. nativescrtipt CLI version. Do I need to upgrade to "NS 7 or NS 8 in order to use the plugin? I was able to build the demo project using 8.1.5 nativescript CLI but was unable to use the same in my project.
You would want to upgrade to NS 6.5 as the differences between 6.4 and 6.5 really are just Mainly elimination of bugs.
Okay so I updated it to NS 6.5 and it still won't work (got the same error again mentioned in the main issue). I tried running Demo project independently by copying it to another location (out of the folder nativescript-websockets-master) and also changed "@master.technology/websockets": "^2.0.3" in package.json file and tried building it but I got an error:
Error executing Static Binding Generator: Couldn't find 'C:\Users\gkadam\Pictures\nativescript-websockets-master\demo\platforms\android\build-tools\sbg-bindings.txt' bindings input file. Most probably there's an error in the JS Parser execution. You can run JS Parser with verbose logging by executing "node 'C:\Users\gkadam\Pictures\nativescript-websockets-master\demo\platforms\android\build-tools\jsparser\js_parser.js' enableErrorLogging".
@NathanaelA can you please help me here? I am still unable to use "@master.technology/websockets" in my project.
Try doing a ns clean
on the project.
ns clean gives "Unknown command clean" error on NS 6.5. So I even tried
The platform add/remove is pretty close to a clean.
npm i -g nativescript@latest
)Yes, I have tried running the Demo project, it works fine only with NS cli 8 and nativescript/core version 8. It does not work with NS 6 and 7 (builds with 7 but gives runtime error module not found).
Yes, I also tried updating nativescript cli to the latest version (8.1.5), It still gives this error in my project:
ERROR in ../node_modules/@master.technology/websockets/websockets.js Module not found: Error: Can't resolve './websockets-base' in 'C:\Users\gkadam\Documents\myproject\node_modules\@master.technology\websockets' @ ../node_modules/@master.technology/websockets/websockets.js 11:25-53 @ ./app/core/services/web-socket.service.ts @ ./app/core/core.module.ts @ ./app/app.module.ts @ ./main.ts Webpack compilation complete. Executing webpack failed with exit code 2.
Can you confirm if this plugin is valid for NS 6 and 7?
The plugin should work fine for both NS 6 and up. However, it must be a NS 6 where the webpack and core modules knows what @nativescript/core
is.
When I have a chance (might be several weeks, since doing anything with this -- is all unpaid, so it has a very low priority) --- I'll clone this repo directly and have it point to the released plugins rather than the relative link and see if I can duplicate the issue.
I am trying to move from "nativescript/websockets" to @master.technology/websockets. I have successfully installed @master.technology/websockets and uninstalled "nativescript/websockets" But I am getting below error during build phase ("tns build android"). I am using nativescript-angular framework. I am using tns-android version 6.5.3
Error: ERROR in ../node_modules/@master.technology/websockets/websockets.js Module not found: Error: Can't resolve './websockets-base' in 'C:\Users\username\Gitlab\App\AppName\node_modules\@master.technology\websockets'
Below is my new code (which is giving an error): require('@master.technology/websockets'); //Earlier it was following code, require('nativescript/websockets') and it was working fine this.webSocket = new WebSocket("ws://echo.websocket.org", []); this.webSocket.on('open', () => {}); this.webSocket.on('close', () => {}); this.webSocket.on('error', () => {}); this.webSocket.on('message', () => {});