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

Adding point series elements on Canvas workpads is failing with error [pointseries] > (0 , _lodash2.default) is not a function #27729

Closed
bhavyarm opened this issue Dec 22, 2018 · 7 comments · Fixed by #27858
Assignees
Labels
blocker bug Fixes for quality problems that affect the customer experience Feature:Canvas PR sent Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v6.6.0
Projects

Comments

@bhavyarm
Copy link
Contributor

bhavyarm commented Dec 22, 2018

Kibana version: 6.6.0 BC1

Browser version: chrome latest

Browser OS version: OS X

Original install method (e.g. download page, yum, from source, etc.): from staging

Describe the bug: When user tries to add point series elements on canvas workpads - they are failing with an error

[pointseries] > (0 , _lodash2.default) is not a function 

You can see this error all over on sample workpads too.

screen shot 2018-12-22 at 10 51 05 am

screen shot 2018-12-22 at 10 55 55 am

@bhavyarm bhavyarm added bug Fixes for quality problems that affect the customer experience blocker Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v6.6.0 labels Dec 22, 2018
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@bhavyarm
Copy link
Contributor Author

@w33ble / @cqliu1

@bhavyarm bhavyarm changed the title Adding elements on Canvas workpads is failing with error [pointseries] > (0 , _lodash2.default) is not a function Adding point series elements on Canvas workpads is failing with error [pointseries] > (0 , _lodash2.default) is not a function Dec 24, 2018
@w33ble
Copy link
Contributor

w33ble commented Dec 26, 2018

#26068 just keeps on giving...

This is actually the same issue as #27162, the broken plugin build is causing both of these issues. @spalger has been working on this in #27171, which should close both of these issues.

@w33ble
Copy link
Contributor

w33ble commented Dec 26, 2018

Looks like #27171 will not close this.

The issue is that the build step isn't correctly converting lodash.uniqby correctly, for some reason.

In case it's helpful, import uniqBy from 'lodash.uniqby' becomes:

var _lodash = require('lodash.uniqby');
var _lodash2 = _interopRequireDefault(_lodash);

_lodash2 there is what is failing, apparently it isn't resolving correctly.


UPDATE: well, I see why it's failing; the dependency in the build is just a 0 byte index.js file.

$ ls -l node_modules/lodash.uniqby
total 8
-rw-r--r--  1 w33ble  staff    0 Dec 26 15:32 index.js
-rw-r--r--  1 w33ble  staff  767 Dec 26 15:32 package.json

I don't know why that happens, but that's certainly why that error shows up.

@spalger
Copy link
Contributor

spalger commented Dec 27, 2018

Sounds like a DLL issue, @mistic can you take a look?

@cqliu1 cqliu1 removed the PR sent label Dec 27, 2018
@mistic
Copy link
Member

mistic commented Dec 27, 2018

@spalger @w33ble the problem is not related with DLL work itself but with a build task we have in place in order to clean up the modules bundled into the dll from the distributable's node_modules folder:

As you can se by this search https://github.com/elastic/kibana/search?q=lodash.uniqby&unscoped_q=lodash.uniqby lodash.uniqby is being imported on x-pack/plugins/canvas/public/lib/function_definitions.js which is public browser code. As so, it will end up bundled into the dll. Then, it is also imported in a canvas server code folder called canvas_plugin_src which is a folder that will be built and as so, it's not reachable from the canvas plugin index.js file and we cannot static analysing it. In the end, in our clean up node_modules task, we will cleaning the lodash.uniqby module because through the static analysis from our server code we can't found it as a server's code dependency. As a solution for this, we can just import {uniqBy} from lodash instead of importing it from lodash.uniqby as lodash is already being tracked as a server's code dependency.

@w33ble
Copy link
Contributor

w33ble commented Dec 28, 2018

import {uniqBy} from lodash

Lodash 3 (the version we're stuck on) does not have that function, which is why the dependency exists. And even if we fix it that way, or otherwise replace lodash.uniqby in that one file, the problem is bound to come up again.

I'll probably do the simple fix for now, but we should figure out a more reliable way to fix this dependency thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug Fixes for quality problems that affect the customer experience Feature:Canvas PR sent Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v6.6.0
Projects
No open projects
Canvas
  
Inbox
Development

Successfully merging a pull request may close this issue.

7 participants