Plugin TypeError: r is not a function
at Object.execScenegraphEdit (plugins/ScenegraphGuard.js:1:3285)
at BaseCommand._invokePluginCommand [as _commandFn] (plugins/PluginLoader.js:1:3296)
at BaseCommand.execute (lib/BaseCommand.js:1:929)
at Commands._execute (lib/Commands.js:1:1915)
at Commands.executeAsGesture (lib/Commands.js:1:2064)
Just if anything rings a bell. I’ll describe how to reproduce it if not.
Basically two commands repeated. Outside any function (runs when plugin is loaded), and inside PopulateWithSearch. The first one gets to index the documents and do a search, but not populate a repeater grid, and the second one (menu choice) errors like above.
@stevekwak Could you help me a little with this bug / issue? I’m trying to get going on the search engine plugin again =)
I guess I need to set up a webpack.config.js with “externals”: “scenegraph” ?
But is it so that I need need to import / require stuff from the sceneGraph in my webpack’able script and then say in my webpack.config.js that it is not to be imported in the webpaced script?
I can’t git clone your repo due to permission issues. Yes - you are right that you have to put XD specific modules in the externals property in your config file.
let repeatGrid = selection.items[0].parent.parent;
let selectedTextNode = selection.items[0]
repeatGrid.attachTextDataSeries(selectedTextNode, searchReults)
Then I need to have this in my webpack’able file:
let {selection} = require('scenegraph')
And this in my webpack.config.js
externals: {
scenegraph: 'scenegraph'
}
I guess that understanding what externals I’m using from XD is the part I’m most unsure aboiut.
But, just setting up the plugin to run when it’s loaded/reloaded seems promising, since I get this error message:
Plugin Error: Plugin cdxxxxxxxx is not permitted to make changes from the background. Use editDocument() for panel UI handlers, or return a Promise to extend an edit operation asynchronously.
Yes, I have it selected, forgot to say that. But that error message is just when I reload the plugin, and have a text within a repeat grid selected. When choosing the function from the menu (still text within repeat grid selected) I get the “Plugin TypeError: r is not a function”-error.
I was more wondering if the require-code and externals-code looked correct, so that I can look at what other stuff might be wrong.
@stevekwak I’ve gotten the edit-part to work earlier, just using some dummy data, so I just wanted to know if the require-part and the externals-part looked okay?
Ah, no, I’m just creating some confusion here, @stevekwak =) Still haven’t gotten it working, just the part without the webpacking and no search-engine, and just with some dummy-data. So I was wondering if the require-part and the externals-part seemed okay?