flex-plugin-builder icon indicating copy to clipboard operation
flex-plugin-builder copied to clipboard

[BUG]: Can't build brand new plugin using flex:plugins:build

Open steverist-tech opened this issue 3 years ago • 2 comments

Description

I have built a brand new plugin using flex CLI

Versions

@twilio-labs/plugin-flex 4.3.1s`.

nodev16.13.2

package version
@twilio/plugin-flex X.Y.Z
flex-plugin-scripts X.Y.Z
node X.Y.Z
npm X.Y.Z

Package.json

{ "name": "D365", "version": "0.0.0", "private": true, "scripts": { "postinstall": "flex-plugin pre-script-check" }, "dependencies": { "flex-plugin-scripts": "4.3.1", "react": "16.5.2", "react-dom": "16.5.2", "react-emotion": "9.2.12" }, "devDependencies": { "@twilio/flex-ui": "^1", "react-test-renderer": "16.5.2" } }

Steps to Reproduce

Please provide the steps to reproduce this bug:

create a new plugin run flex:[lugins:build

Expected Behavior

Builds without error

Screenshots

[DEBUG] Config File: C:\Users\SteveRist.twilio-cli\config.json [DEBUG] Using profile: ${TWILIO_ACCOUNT_SID}/${TWILIO_AUTH_TOKEN} [DEBUG] Using Plugins CLI version 4.3.1 [DEBUG] Using Flex Plugins Config File: C:\Users\SteveRist.twilio-cli\flex\plugins.json [DEBUG] Using flex-plugin-scripts version undefined [DEBUG] Found command "flex:plugins:build" plugin: @twilio-labs/plugin-flex » twilio-cli encountered an unexpected error. To report this issue, execute the command with the "-l debug" flag, then copy the output to a new issue here: "https://github.com/twilio/flex-plugin-builder/issues" [DEBUG] ENOENT: no such file or directory, open 'C:\Users\SteveRist\D365\node_modules\react\package.json' [DEBUG] Error: ENOENT: no such file or directory, open 'C:\Users\SteveRist\D365\node_modules\react\package.json' at Object.openSync (node:fs:585:3) at Object.readFileSync (node:fs:453:35) at Object.readPackageJson (C:\Users\SteveRist.twilio-cli\node_modules\flex-dev-utils\dist\fs.js:134:36) at Object.getPaths (C:\Users\SteveRist.twilio-cli\node_modules\flex-dev-utils\dist\fs.js:716:38) at FlexPluginsBuild.getPluginServiceOptions (C:\Users\SteveRist.twilio-cli\node_modules@twilio-labs\plugin-flex\dist\sub-commands\flex-plugin.js:496:34) at FlexPluginsBuild.run (C:\Users\SteveRist.twilio-cli\node_modules@twilio-labs\plugin-flex\dist\sub-commands\flex-plugin.js:262:43) at async FlexPluginsBuild._run (C:\Users\SteveRist.twilio-cli\node_modules@oclif\command\lib\command.js:43:20) at async Config.runCommand (C:\Program Files (x86)\twilio-cli\client\node_modules@oclif\config\lib\config.js:173:24) at async Main.run (C:\Program Files (x86)\twilio-cli\client\node_modules@oclif\command\lib\main.js:27:9) at async Main._run (C:\Program Files (x86)\twilio-cli\client\node_modules@oclif\command\lib\command.js:43:20)

Additional Context

Add any other context about the problem here.

steverist-tech avatar Feb 11 '22 10:02 steverist-tech

@steverist-tech did you npm install after you created a new plugin? Is there a C:\Users\SteveRist\D365\node_modules folder?

ktalebian avatar Feb 11 '22 18:02 ktalebian

Thanks Koshua. Thay did it.

Unfortunately, I now have the error loadJS.ready is not a function. This is from your sample code in the article about integrating with Dynamics 365.

import React from 'react'; import { VERSION } from @.***/flex-ui'; import { FlexPlugin, loadJS } from 'flex-plugin';

import CustomTaskListContainer from './components/CustomTaskList/CustomTaskList.Container'; import reducers, { namespace } from './states';

const PLUGIN_NAME = 'D365Plugin';

export default class D365Plugin extends FlexPlugin { constructor() { super(PLUGIN_NAME); }

/**

  • This code is run when your plugin is being started
  • Use this to modify any UI components or attach to the actions framework
  • @param flex { typeof @.***/flex-ui') }
  • @param manager { @.***/flex-ui').Manager } */ async init(flex, manager) { this.registerReducers(manager);
const options = { sortOrder: -1 };
loadJS('https://orgdbe16625.crm11.dynamics.com/webresources/Widget/msdyn_ciLibrary.js', 'CIF');


loadJS.ready('CIF', function() {
  window.Microsoft.CIFramework.addHandler("onclicktoact", function() {})
});

flex.AgentDesktopView.Panel1.Content.add(<CustomTaskListContainer key="D365Plugin-component" />, options);
flex.AgentDesktopView.defaultProps.showPanel2 = false;

}

From: Kousha Talebian @.> Sent: 11 February 2022 18:35 To: twilio/flex-plugin-builder @.> Cc: Steve Rist @.>; Mention @.> Subject: Re: [twilio/flex-plugin-builder] [BUG]: Can't build brand new plugin using flex:plugins:build (Issue #670)

@steverist-techhttps://github.com/steverist-tech did you npm install after you created a new plugin? Is there a C:\Users\SteveRist\D365\node_modules folder?

— Reply to this email directly, view it on GitHubhttps://github.com/twilio/flex-plugin-builder/issues/670#issuecomment-1036503049, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXW6BX5N5NUGBZ56PQS62TDU2VJFNANCNFSM5ODXSJQA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.@.>>

steverist-tech avatar Feb 12 '22 09:02 steverist-tech

Hi,

This is a long open item more than a year now, hence closing it. Feel free to reopen it if still required.

anjha91 avatar Oct 04 '23 08:10 anjha91