Comments (13)
Yes the error continues. Seems to me that in the new version ends this problem.
from autobahn-js.
I looked at the source code and it seems that there is two problems
- The autobahn.js file defines two modules (autobahn & when) which is forbidden. There should only be one module definition per file on disk.
- Some methods of the "autobahn object" are defined outside the module definition.
from autobahn-js.
Currently AMD loading can not work as it is.
The simplest solution to this problem would be to build two file :
- autobahn.js (with when.js)
- autobahn.amd.js (without when.js)
The autobahn.js file can be provided in a single file with when module inside nevertheless we must point out that the "exports" feature in requireJS would not work as expected due to the when module definition see http://requirejs.org/docs/api.html#config-shim
require.config({
baseUrl: ".",
paths: {
"autobahn": "//autobahn.s3.amazonaws.com/js/autobahn"
},
shim: {
"autobahn": {
exports: 'ab'
}
}
});
The autobahn.amd.js would not include include when module and therefore would require when as a module dependency in the require.js configuration.
require.config({
baseUrl: ".",
paths: {
"autobahn": "//autobahn.s3.amazonaws.com/js/autobahn",
"when": "//cdnjs.cloudflare.com/ajax/libs/when/2.7.1/when"
},
shim: {
"autobahn": {
deps: ["when"]
}
}
});
What do you think about it ?
from autobahn-js.
Are you having the issue with the old WAMP v1 implementation?
https://github.com/tavendo/AutobahnJS/tree/wamp1
https://autobahn.s3.amazonaws.com/js/autobahn.js
or the new AutobahnJS for WAMP v2
https://github.com/tavendo/AutobahnJS
https://autobahn.s3.amazonaws.com/autobahnjs/latest/autobahn.js
?
The new AutobahnJS is built for browsers using Browserify. The old AutobahnJS did include manual code trying to make it compatible with usual module systems.
from autobahn-js.
If this refers to the old AutobahnJS (WAMPv1) implementation: this is no longer supported anyway. If the issue is for the new implementation, please reopen ..
from autobahn-js.
Ive got the same error. Any solution ? I think i tried every possible configuration. I tried to use autobahn directly from autobahn.s3.amazonaws.com/js/autobahn and also i installed it through bower. In first case ive got an error "ReferenceError: ab is not defined" and in second case its seem that there is e problem with loading "submodules" as when and session and the other that are required by autobahn. "ReferenceError: module is not defined module.exports = require('./lib/autobahn');" so it look like there is problem with module.export. I tried to load all libs manually without any success. I will be very very gratefull for any advice , how to run autobahn with requirejs , it took me too much time already. Btw. i`m using the newest version.
from autobahn-js.
this works for me: https://github.com/tavendo/AutobahnJS/blob/master/package/test/test_require.html
from autobahn-js.
this also works: https://github.com/tavendo/AutobahnJS/blob/master/package/test/test_require2.html
I've added this info to the readme: https://github.com/tavendo/AutobahnJS#amd-and-requirejs
from autobahn-js.
Thanks. That works. But there is another issue. Im using Rachet(http://socketo.me/) Wamp, and i
ve got this error: Protocol violation: unexpected message type 0, server response is
[0, "5313c015641d6", 1, "Ratchet/0.3"],
i did a little check and it look like 0 (first in array) in Ratchet is Welecome message, but in autobahn is 2 (but i`m not sure is this is a problem). I wonder is that have something to do witch autobahn update to v2. Or maybe problem is somewhere else.
from autobahn-js.
Probably Ratchet is not yet on version 2 of WAMP ..
from autobahn-js.
Ratchet is still on v1. You should use the AutobahnJS version that is compatible with v1 of the WAMP protocol.
from autobahn-js.
@galthron In this case, you should use:
https://github.com/tavendo/AutobahnJS/tree/wamp1
https://autobahn.s3.amazonaws.com/js/autobahn.js
@cboden Any plans to upgrade Ratchet to v2?
from autobahn-js.
I do plan to. I just haven't had much time for OS lately, unfortunately.
from autobahn-js.
Related Issues (20)
- Subprotocol error when creating connection with [email protected] HOT 9
- Connections failed on SSL HOT 2
- Is there any way to send a blob? HOT 1
- autobahn.Error should contain the "details" parameter HOT 1
- Add a HarmonyOS-supported polyfill
- uncaught referenceerror: cr is not defined at <anonymous>:2:3
- Implement Payload Passthru Mode HOT 1
- Release 22.10.1 HOT 3
- autobahn js => es6 ? HOT 3
- cbor: problem sending payload larger than 16kb HOT 2
- Release v22.11.1
- Support latest ws 8.x
- Wrapping/unwrapping invocation results HOT 7
- How disconnect or close connection? HOT 1
- Subscribe does not fire when something is published
- Session detached after new session attached, resulting in `wamp.error.procedure_already_exists` HOT 5
- can you make a rpc call outside of onopen ? so you dont have to make parrallel connections everytime you want to make a call ?
- Support call cancelling via AbortController
- WebSocket connection to 'wss://site.com/socket/' failed
- Correct copyright holder 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 autobahn-js.