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

Cannot read property 'map' of null" Warning leads to Error #159

Closed
jasperf opened this issue Sep 24, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@jasperf
Copy link

commented Sep 24, 2018

Getting this warning post upgrade to Laravel Mix 2.1 under Laravel 5.5 with latest Vue Color "vue-color": "^2.6.0",

[Vue warn]: Error in render: "TypeError: Cannot read property 'map' of null"
found in
---> <Compact> at src/components/Compact.vue

It is triggered by

warn = function (msg, vm) {
    var trace = vm ? generateComponentTrace(vm) : '';

    if (config.warnHandler) {
      config.warnHandler.call(null, msg, vm, trace);
    } else if (hasConsole && (!config.silent)) {
      console.error(("[Vue warn]: " + msg + trace));
    }
  };

This warning leads to an error

TypeError: Cannot read property 'map' of null
    at VueComponent.paletteUpperCase

Which refers to

paletteUpperCase: function(e) {
                        return e.map(function(e) {
                            return e.toUpperCase()
                        })
                    },

Any ideas why this is popping up now and what to do?

@linx4200

This comment has been minimized.

Copy link
Collaborator

commented Sep 24, 2018

I think it's cause by missing prop palette, but this prop should have default value. You can try to pass palette to Compact.vue, see if the error go away:

const defaultColors = [
  '#4D4D4D', '#999999', '#FFFFFF', '#F44E3B', '#FE9200', '#FCDC00',
  '#DBDF00', '#A4DD00', '#68CCCA', '#73D8FF', '#AEA1FF', '#FDA1FF',
  '#333333', '#808080', '#CCCCCC', '#D33115', '#E27300', '#FCC400',
  '#B0BC00', '#68BC00', '#16A5A5', '#009CE0', '#7B64FF', '#FA28FF',
  '#000000', '#666666', '#B3B3B3', '#9F0500', '#C45100', '#FB9E00',
  '#808900', '#194D33', '#0C797D', '#0062B1', '#653294', '#AB149E'
]


<Compact :platte="defaultColors" :color="color" @change="updateValue" />
@jasperf

This comment has been minimized.

Copy link
Author

commented Sep 25, 2018

Will test later on this week or beginning next week. Thanks @linx4200 . Reverted briefly to 2.3.2 for now to solve some other bugs and will then try the 2.6.2 with your suggestions

@linx4200 linx4200 added the question label Sep 27, 2018

@linx4200

This comment has been minimized.

Copy link
Collaborator

commented Oct 10, 2018

Closing this issue for now. Let us know if you have anything to add.

@linx4200 linx4200 closed this Oct 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.