developit / preact-redux

:loop: Preact integration for Redux (no shim needed!)
https://npm.im/preact-redux
MIT License
288 stars 27 forks source link

Build fails: 'isValidElementType' is not exported by `react-is` #43

Closed ohmoses closed 5 years ago

ohmoses commented 5 years ago

I cloned the repo and ran yarn. This runs (among others) the build command, which in turn runs (among others) the transpile:umd command, which fails like so:

$ rollup -c --environment FORMAT:umd
🚨   'isValidElementType' is not exported by node_modules/react-is/index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
node_modules/react-redux/src/components/connectAdvanced.js (4:9)
2: import invariant from 'invariant';
3: import { Component, createElement } from 'react';
4: import { isValidElementType } from 'react-is';
            ^
5: 
6: import Subscription from '../utils/Subscription';

error Command failed with exit code 1.

Node v10.15.1 npm v6.9.0 yarn v1.15.2 Ubuntu v18.10

lauritzsh commented 5 years ago

@ohmoses I fixed this by using specific dependency version in package.json. Like this:

{
  "name": "preact-redux",
  "amdName": "preactRedux",
  "version": "2.0.3",
  "description": "Wraps react-redux up for Preact, without preact-compat",
  "main": "dist/preact-redux.js",
  "module": "dist/preact-redux.esm.js",
  "types": "src/preact-redux.d.ts",
  "jsnext:main": "dist/preact-redux.esm.js",
  "minified:main": "dist/preact-redux.min.js",
  "scripts": {
    "clean": "rimraf dist/",
    "build": "npm-run-all clean transpile:* minify size",
    "transpile:umd": "rollup -c --environment FORMAT:umd",
    "transpile:es": "rollup -c --environment FORMAT:es",
    "minify": "uglifyjs dist/preact-redux.js --define NODE_ENV=production --pure-funcs classCallCheck Object.defineProperty Object.freeze invariant warning -c unsafe,collapse_vars,evaluate,screw_ie8,loops,keep_fargs=false,pure_getters,unused,dead_code -m -o dist/preact-redux.min.js -p relative --in-source-map dist/preact-redux.js.map --source-map dist/preact-redux.min.js.map",
    "size": "gzip-size dist/preact-redux.min.js",
    "test": "cross-env NODE_ENV=development npm-run-all lint transpile:* test:karma",
    "lint": "eslint {src,test}",
    "test:karma": "karma start --single-run",
    "test:watch": "karma start",
    "prepublish": "npm-run-all build test",
    "release": "cross-var npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
  },
  "keywords": [
    "preact",
    "redux"
  ],
  "files": [
    "src",
    "dist"
  ],
  "author": "Jason Miller <jason@developit.ca>",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/developit/preact-redux.git"
  },
  "bugs": {
    "url": "https://github.com/developit/preact-redux/issues"
  },
  "homepage": "https://github.com/developit/preact-redux",
  "peerDependencies": {
    "preact": ">=3",
    "redux": ">=2"
  },
  "devDependencies": {
    "babel-cli": "6.24.1",
    "babel-core": "6.24.1",
    "babel-eslint": "7.2.1",
    "babel-loader": "7.0.0",
    "babel-plugin-external-helpers": "6.22.0",
    "babel-plugin-transform-class-properties": "6.24.1",
    "babel-plugin-transform-es2015-classes": "6.24.1",
    "babel-plugin-transform-node-env-inline": "6.8.0",
    "babel-plugin-transform-object-assign": "6.22.0",
    "babel-plugin-transform-react-jsx": "6.24.1",
    "babel-plugin-transform-react-remove-prop-types": "0.4.1",
    "babel-preset-es2015": "6.24.1",
    "babel-preset-react": "6.24.1",
    "babel-preset-stage-0": "6.24.1",
    "chai": "3.5.0",
    "cross-env": "4.0.0",
    "cross-var": "1.0.3",
    "diff": "3.2.0",
    "eslint": "3.19.0",
    "eslint-plugin-react": "6.10.3",
    "gzip-size-cli": "2.0.0",
    "karma": "1.6.0",
    "karma-chai-sinon": "0.1.5",
    "karma-mocha": "1.3.0",
    "karma-mocha-reporter": "2.2.3",
    "karma-phantomjs-launcher": "1.0.4",
    "karma-sourcemap-loader": "0.3.7",
    "karma-webpack": "2.0.3",
    "mkdirp": "0.5.1",
    "mocha": "3.2.0",
    "npm-run-all": "4.0.2",
    "phantomjs-prebuilt": "2.1.14",
    "preact": "8.1.0",
    "pretty-bytes-cli": "2.0.0",
    "react-redux": "5.0.4",
    "redux": "4.0.0",
    "rimraf": "2.6.1",
    "rollup": "0.41.6",
    "rollup-plugin-alias": "1.2.1",
    "rollup-plugin-babel": "2.7.1",
    "rollup-plugin-commonjs": "8.0.2",
    "rollup-plugin-es3": "1.0.3",
    "rollup-plugin-memory": "2.0.0",
    "rollup-plugin-node-resolve": "3.0.0",
    "rollup-plugin-replace": "1.1.1",
    "sinon": "2.1.0",
    "sinon-chai": "2.9.0",
    "uglify-js": "2.8.22",
    "webpack": "2.3.3"
  }
}
fjorgemota commented 5 years ago

By the way, this is one of the things that #41 fixes. =)

fjorgemota commented 5 years ago

Just as an FYI, the master branch should already works without any problems. =)

ohmoses commented 5 years ago

Yep! Closing issue