Comments (7)
Thank you @rm8x!
What error does occur? I can't reproduce the problem, this here does not throw any errors in version 1.2.0
:
const OSC = require('osc-js')
var plugin = new OSC.WebsocketClientPlugin({
host: 'localhost',
port: 44121,
})
const osc = new OSC({
plugin,
})
from osc-js.
I have this error also when using the example here https://github.com/adzialocha/osc-js/wiki/Node.js-Server#websocket-server-example
from osc-js.
@jarmitage Are you sure you are using the right plugins? When working with the only browser version (for Webpack builds for exampe), the plugin is called WebsocketBrowserPlugin
(which is also set by default), when working with the normal version it is WebsocketClientPlugin
. @rm8x
Example using the browser version:
var osc = new OSC();
var plugin = new OSC.WebsocketBrowserPlugin({
host: 'localhost',
port: 44121,
})
osc.open({ plugin });
from osc-js.
I updated the Wiki (https://github.com/adzialocha/osc-js/wiki/Webpack-Bundling), maybe this point was too confusing before
from osc-js.
I get the same error (OSC.DatagramPlugin is not a constructor
) when trying to run the UDP example (https://github.com/adzialocha/osc-js/wiki/Node.js-Server#udp-server-example)
I'm trying to do something equivalent to this: https://github.com/colinbdclark/osc.js-examples/tree/master/browser
from osc-js.
@jarmitage as long as you are using the browser version this wont work either (as mentioned only WebsocketBrowserPlugin
is possible then). Please use the normal osc-js version if you want to work with UDP.
If the problem still occurs I would need more information (Webpack configuration, source code) to really help you
from osc-js.
Hi.
I'm getting similar erros as the described above. I'm going to give the information I think would be useful. Please tell me if there is something missing or if I can help somehow.
My particular case is an application made with Vue/Nuxt + express, and I'm following the osc-js-webpack-example.
I got errors both in the server and client sides.
In the client the error is this:
{ TypeError: __WEBPACK_IMPORTED_MODULE_5_osc_js___default.a is not a constructor
at VueComponent.data (pages/index.1b33cb139b7bbca63b19.js:113:10)
...
The VueComponent.data
points to where the new OSC()
is.
The webpack.config is not exposed in Nuxt, but there is a nuxt.config from which one can configure Webpack, specifically in this part:
extend(config, ctx) {
config.resolve.alias['osc-js'] = path.resolve(__dirname, 'node_modules/osc-js/lib/osc.browser.js')
// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/,
})
}
}
In the server side I'm getting this error:
const osc = new OSC({ plugin: new OSC.WebsocketServerPlugin() })
^
TypeError: OSC.WebsocketServerPlugin is not a constructor
My package.json file is like so (thinking about what could be useful to understand what's going on):
{
"name": "deslugar",
"version": "1.0.0",
"description": "non-local osc jam",
"author": "Gil Fuser",
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
"build": "nuxt build",
"start": "cross-env NODE_ENV=production nodemon server/index.js",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint"
},
"dependencies": {
"@nuxtjs/axios": "^5.0.0",
"express": "^4.15.3",
"nuxt": "^1.0.0",
"osc-js": "^1.2.2",
"signalhub": "^4.9.0",
"socket.io": "^2.1.1",
"socket.io-client": "^2.1.1",
"webrtc-swarm": "^2.9.0",
"wrtc": "^0.2.0"
},
"devDependencies": {
"ajv": "^6.5.3",
"babel-eslint": "^8.2.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"cross-env": "^5.0.1",
"eslint": "^4.19.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-vue": "^4.0.0",
"nodemon": "^1.11.0"
}
}
... and and webpack version 3.12.0
I really like that project and would like to experiment and use osc-js, so, any help would be much appreciated.
best regards,
Gil
from osc-js.
Related Issues (20)
- Accept full URL in osc.open() HOT 1
- Uncaught ReferenceError: OSC is not defined HOT 1
- ModuleNotFoundError: Module not found: Error: Can't resolve 'dgram' in [...] HOT 8
- Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
- Connecting to another device on the network fails with host: localhost. need 0.0.0.0
- Browser(http) osc message to Reaper(udp) HOT 4
- Use TypeScript HOT 4
- Implement booleans HOT 5
- Integer bundle timetags ignored HOT 3
- Use another documentation generator
- Export `Message` class (and possibly other classes)
- ERR_SOCKET_DGRAM_NOT_RUNNING HOT 1
- Can we avoid using websocket and use the library in the browser? HOT 2
- From maxmsp to browser HOT 1
- TypeScript compile error because of incompatible override of Atomic.unpack by its subclasses HOT 2
- Event listener on server on client connect
- Trouble sending osc message to UDP client in LAN network HOT 1
- Handling errors in unpack in Node.js HOT 2
- Nested bundles cannot be processed
- http package is deprecated, so I cannot install osc-js. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osc-js.