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

Requirejs: Uncaught TypeError: Cannot freeze #23

Open
numediaweb opened this issue Jun 28, 2017 · 3 comments
Open

Requirejs: Uncaught TypeError: Cannot freeze #23

numediaweb opened this issue Jun 28, 2017 · 3 comments

Comments

@numediaweb
Copy link

I'm using this module inside requirejs and I don't know what I changed and now I get this error:

datepickk.js:1146 Uncaught TypeError: Cannot freeze
    at Function.freeze (<anonymous>)
    at Datepickk (datepickk.js:1146)
    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)

If I just return that; the script works as it should inside requirejs.
What drives me crazy is It used to work before and I didn't change anything on my code!

This is how I call it:

# main.js
require.config({
    paths: {
        'Datepickk': '../../build/bower_components/datepickk/dist/datepickk'
    }
});

# home.js
define(['jquery', 'Chart', 'Datepickk'], function ($, Chart, datepicker) {
    var Widget = function () {
    };
    Widget.prototype = {
        init: function (scope) {
            "use strict";
            var widget = this;
            console.log(datepicker);
...
@numediaweb
Copy link
Author

@numediaweb
Copy link
Author

I finally got an answer here explaining why this happens:
https://stackoverflow.com/questions/44808397/requirejs-amd-module-not-defined/44822995#44822995

@crsten
Copy link
Owner

crsten commented Jun 30, 2017

Thanks for your research!

If you find the time i would be thankful if you send a PR.

Otherwise i will try to fix it asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants