Giter Club home page Giter Club logo

Comments (6)

rnairtwilio avatar rnairtwilio commented on September 28, 2024

Hi @jamesscaggs, is this a plugin that you have deployed before on your Flex instance? Also we currently only support developing plugins against the React version 16.5.2 although we are working on supporting newer versions of React. Also did you also delete the package-lock.json before running npm install?

from flex-plugin-builder.

ktalebian avatar ktalebian commented on September 28, 2024

@jamesscaggs to add to @rnairtwilio's comment, we unfortunately currently only support React v16.5.2. It must be left pinned to that older version. This is on our radar to fix this issue and allow developers to use any version of React they wish.

from flex-plugin-builder.

jamesscaggs avatar jamesscaggs commented on September 28, 2024

@rnairtwilio Yes, this flex plugin is deployed an in production.

I deleted the package-lock.json before running npm install.

@ktalebian

The thing is my master branch package.json has the correct version of React but still throws the same error. I've been bypassing it the whole time by skipping the pre-flight check but I am hoping to get to the bottom of it.

See master branch package.json below

{
  "name": "plugin-facebook-messages",
  "version": "0.0.0",
  "scripts": {
    "bootstrap": "flex-plugin check-start",
    "prebuild": "rm -rf build && npm run bootstrap",
    "build": "flex-plugin build",
    "clear": "flex-plugin clear",
    "predeploy": "npm run build",
    "deploy": "flex-plugin deploy",
    "eject": "flex-plugin eject",
    "info": "flex-plugin info",
    "postinstall": "npm run bootstrap",
    "list": "flex-plugin list",
    "remove": "flex-plugin remove",
    "prestart": "npm run bootstrap",
    "start": "flex-plugin start",
    "test": "flex-plugin test --env=jsdom"
  },
  "dependencies": {
    "craco-config-flex-plugin": "^3.0.6",
    "dotenv": "^8.2.0",
    "flex-dev-utils": "^3.3.4",
    "flex-plugin": "^3.0.0",
    "flex-plugin-scripts": "^3.2.0",
    "keytar": "^5.0.0",
    "react": "16.5.2",
    "react-dom": "16.5.2",
    "react-scripts": "3.2.0"
  },
  "devDependencies": {
    "@twilio/flex-ui": "^1",
    "babel-polyfill": "^6.26.0",
    "enzyme": "^3.10.0",
    "enzyme-adapter-react-16": "^1.14.0"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Any other ideas?

from flex-plugin-builder.

ktalebian avatar ktalebian commented on September 28, 2024

The script checks the version by reading node_modules/react/package.json. If it says you have v16.13.1 installed then that's the version inside your node_modules. I would recommend deleting node_modules and package-lock.json and re-installing.

Also, verify the version manually by running grep version node_modules/react/package.json and see what version is actually installed. Also, remove flex-dev-utils - you don't/shouldn't install that package; it's a dependency of our scripts and they will install whatever version they require.

Another caveat: you may also want to upgrade craco-config-flex-plugin, flex-plugin, flex-plugin-scripts, and react-scripts to their latest versions.

from flex-plugin-builder.

jamesscaggs avatar jamesscaggs commented on September 28, 2024

@ktalebian @rnairtwilio

I got it resolved.

Uninstalled create-flex-plugin globally

Updated my scripts and dependencies to match the migrating from 2.x to 3.x doc,

Then:
Deleted node_modules
Deleted package-lock.json
npm install

I'll go ahead and remove the dev-utils script for good measure.

Thanks!

from flex-plugin-builder.

ktalebian avatar ktalebian commented on September 28, 2024

Glad it all worked out. You can also update the create-flex-plugin using npm install -g create-flex-plugin@latest. You may have had an older version, but the newer versions do notify it whenever there is an update available for it.

from flex-plugin-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.