Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible front-end bug #2301

Closed
ORESoftware opened this issue Jan 20, 2017 · 4 comments
Closed

possible front-end bug #2301

ORESoftware opened this issue Jan 20, 2017 · 4 comments

Comments

@ORESoftware
Copy link

ORESoftware commented Jan 20, 2017

I am loading v 5.0.1 with RequireJS in the browser like so:

'rxjs': '//cdnjs.cloudflare.com/ajax/libs/rxjs/5.0.1/Rx'

I just added rxjs to my build, I get this error immediately when the page loads:

Rx.js:388 Uncaught TypeError: __extends is not a function
    at Rx.js:388
    at Object.<anonymous> (Rx.js:399)
    at Object.execCb (require.js:1693)
    at Module.check (require.js:881)
    at Module.enable (require.js:1173)
    at Module.init (require.js:786)
    at callGetModule (require.js:1200)
    at Object.completeLoad (require.js:1587)
    at HTMLScriptElement.onScriptLoad (require.js:1714)

Here is my RequireJS config:

requirejs.config({

    enforceDefine: false,
    waitSeconds: 7,
    baseUrl: '/',
    paths: {
    
        'rxjs': '//cdnjs.cloudflare.com/ajax/libs/rxjs/5.0.1/Rx',
        'async': '//cdnjs.cloudflare.com/ajax/libs/async/2.1.4/async',
        'react-dom': '//cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom',
        'react': '//cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-with-addons',
        'socketio': '//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io',
        '@hot-reload-handler': 'js/hot-reload-handler',
        '@hot-reloader': 'js/hot-reloader',
        'immutable':'//cdnjs.cloudflare.com/ajax/libs/immutable/3.8.1/immutable',
   
    },

    'shim': { }

});

const deps = [
    'react-dom',
    'react',
    'socketio',
    'async',
    'rxjs',
    'immutable'
];

require(deps, function () {

    require(['js/application'], function (Application) {

        Application.start();

    });

});

just wondering if you have seen this error before, seems problematic, since all I am doing is loading the script, doubt it's me/my code.

@kwonoj
Copy link
Member

kwonoj commented Jan 20, 2017

Closing as dupe of #2177 .

@kwonoj kwonoj closed this as completed Jan 20, 2017
@ORESoftware
Copy link
Author

ORESoftware commented Jan 20, 2017

thank you will read the link; is there a good fix for this? I am not seeing it

@ORESoftware
Copy link
Author

I am using TypeScript + Rxjsv5.0.1 + RequireJS, I solved this by using a shim in my RequireJS config

    'shim': {
        'rxjs':{
            deps: ['tslib']
        }
    }

tslib is library from TypeScript that apparently exports some global helper functions

@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants