Storybook publish step failing in monorepo - reactjs

Current Behavior
Getting semicolon missing error only on publish to storybook-to-ghpages step.
Expected Behavior
Should deploy the stories to GitHub pages.
Steps to Reproduce
Create a new nx workspace.
Create two new react libraries using nx console vs code extension.
Running storybook locally works fine using nx run project-name:storybook.
When trying to deploy to github pages using npx -p #storybook/storybook-deployer storybook-to-ghpages you will get missing semicolon error.
You can also watch this youtube video to see how to reproduce:
https://www.youtube.com/watch?v=c323HOuFKkA
Our package.json at the root:
{
"name": "cxc-react-monorepo",
"version": "0.0.0",
"private": true,
"scripts": {
"prepare": "husky install",
"start": "nx serve",
"build": "nx run-many --target=build --all",
"build:icons": "nx run cxc-react-icons:build-icons",
"test": "nx run-many --target=test --all",
"graph": "nx graph",
"lint": "nx workspace-lint && nx lint",
"e2e": "nx e2e",
"affected:libs": "nx affected:libs",
"affected:build": "nx affected:build",
"affected:e2e": "nx affected:e2e",
"affected:test": "nx affected:test",
"affected:lint": "nx affected:lint",
"affected:graph": "nx affected:graph",
"commit": "git cz",
"version": "lerna version",
"version:beta": "lerna version --conventional-prerelease",
"release:ci": "lerna publish from-package"
},
"dependencies": {
"#ford/ford-design-system": "^18.3.0",
"axios": "^0.27.2",
"clsx": "^1.1.1",
"core-js": "^3.6.5",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-hook-form": "^7.31.3",
"regenerator-runtime": "0.13.7",
"tslib": "^2.3.0",
"valtio": "^1.6.0"
},
"devDependencies": {
"#nrwl/cli": "14.1.4",
"#nrwl/cypress": "14.1.4",
"#nrwl/eslint-plugin-nx": "14.1.4",
"#nrwl/jest": "14.1.4",
"#nrwl/linter": "14.1.4",
"#nrwl/react": "14.1.4",
"#nrwl/web": "14.1.4",
"#nrwl/workspace": "14.1.4",
"#testing-library/jest-dom": "^5.16.4",
"#testing-library/react": "^13.2.0",
"#testing-library/user-event": "^14.2.0",
"#types/jest": "27.4.1",
"#types/node": "16.11.7",
"#types/react": "18.0.8",
"#types/react-dom": "18.0.3",
"#types/react-modal": "^3.13.1",
"#typescript-eslint/eslint-plugin": "~5.18.0",
"#typescript-eslint/parser": "~5.18.0",
"babel-jest": "27.5.1",
"chalk": "^2.4.1",
"cypress": "^9.1.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "~8.12.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-cypress": "^2.10.3",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.5.0",
"husky": "^8.0.1",
"jest": "27.5.1",
"lerna": "^4.0.0",
"nx": "14.1.4",
"prettier": "^2.5.1",
"react-modal": "^3.15.1",
"react-test-renderer": "^18.1.0",
"shelljs": "^0.8.2",
"svgr": "^1.10.0",
"ts-jest": "27.1.4",
"ts-node": "9.1.1",
"typescript": "~4.6.2"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
Failure Logs
RROR in
src/stories/Button.stories.tsx
Line 13:2: Parsing error: Missing semicolon
11 | backgroundColor: { control: 'color' },
12 | },
> 13 | } as Meta;
| ^
14 |
15 | const Template: Story<ButtonProps> = (args) => <Button {...args} />;
16 |
Environment
nx : 14.1.9
#nrwl/angular : Not Found
#nrwl/cypress : 14.1.9
#nrwl/detox : Not Found
#nrwl/devkit : 14.1.9
#nrwl/eslint-plugin-nx : 14.1.9
#nrwl/express : Not Found
#nrwl/jest : 14.1.9
#nrwl/js : 14.1.9
#nrwl/linter : 14.1.9
#nrwl/nest : Not Found
#nrwl/next : Not Found
#nrwl/node : Not Found
#nrwl/nx-cloud : Not Found
#nrwl/nx-plugin : Not Found
#nrwl/react : 14.1.9
#nrwl/react-native : Not Found
#nrwl/schematics : Not Found
#nrwl/storybook : 14.1.9
#nrwl/web : 14.1.9
#nrwl/workspace : 14.1.4
typescript : 4.6.4
rxjs : 6.6.7

Related

React / Next - TypeError: Cannot read properties of undefined (reading 'compat')

All of a sudden I am getting an issue when trying to run npm build.
The error I get is as follows (for all pages):
Error occurred prerendering page "/sharelink/Index". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of undefined (reading 'compat')
> Build error occurred
Error: Export encountered errors on following paths
Here is my package.json
{
"name": "nextjstemplate",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 14009",
"build": "next build",
"start": "next start -p 14009",
"lint": "next lint",
"prepare": "husky install",
"postinstall": "npm run prepare",
"eslint": "eslint \"**/*.+(js|jsx|ts|tsx)\"",
"eslint:fix": "eslint --fix \"**/*.+(js|jsx|ts|tsx)\"",
"prettier": "prettier --check \"**/*.+(js|jsx|ts|tsx|json|yml|yaml|md|css|scss)\"",
"prettier:fix": "prettier --write \"**/*.+(js|jsx|ts|tsx|json|yml|yaml|md|css|scss)\"",
"pre-commit": "lint-staged"
},
"dependencies": {
"#emotion/react": "^11.10.0",
"#emotion/server": "^11.10.0",
"#emotion/styled": "^11.10.0",
"#hookform/resolvers": "^2.9.10",
"#mui/base": "^5.0.0-alpha.105",
"#mui/icons-material": "^5.10.6",
"#mui/material": "^5.11.3",
"#mui/system": "^5.10.10",
"#mui/x-date-pickers": "^5.0.8",
"#reduxjs/toolkit": "^1.8.6",
"axios": "^1.1.3",
"cookies-next": "^2.1.1",
"crypto": "^1.0.1",
"dompurify": "^2.4.3",
"html-react-parser": "^3.0.8",
"lottie-react": "^2.3.1",
"moment": "^2.29.4",
"next": "^12.3.0",
"next-progress": "^2.2.0",
"next-pwa": "5.5.4",
"nextjs-progressbar": "^0.0.14",
"notistack": "^2.0.8",
"pm2": "^5.2.2",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.40.0",
"react-redux": "^8.0.2",
"react-share": "^4.4.1",
"react-slick": "^0.29.0",
"react-toastify": "^9.1.1",
"sass": "^1.54.5",
"slick-carousel": "^1.8.1",
"yup": "^0.32.11"
},
"devDependencies": {
"#commitlint/cli": "^17.1.2",
"#commitlint/config-conventional": "^17.1.0",
"cypress": "^10.6.0",
"eslint": "8.22.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-next": "12.2.5",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-css-modules": "^2.11.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-mui-path-imports": "^0.0.3",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1"
},
"lint-staged": {
"./*/**/*.{js,jsx,ts,tsx}": [
"npm run prettier:fix",
"npm run eslint:fix"
],
"*.{json,md}": [
"npm run prettier:fix"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
Just to add to the above, the error seems more likely to be in relation to emotion.
error - TypeError: Cannot read properties of undefined (reading 'compat')
at /var/www/vhosts/staging-site.co.uk/node_modules/#emotion/react/dist/emotion-react.cjs.dev.js:190:29
at /var/www/vhosts/staging-site.co.uk/node_modules/#emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js:66:16
Any ideas on what is the cause for this issue?
This issue is caused by an update in #mui/styled-engine that apparently removes the CacheProvider from emotion.
You can force the resolution of this package to a previous version in the package.json as a workaround meanwhile the issue is not being fixed.
{
...,
"resolutions": {
"#mui/styled-engine": "5.11.0"
}
}
You can track the status of the issue here: https://github.com/mui/material-ui/issues/36096

npm run build error: Linting and checking validity of types ...Error: Cannot find module 'escope'

Upgraded my project's package.json & did some audit fixes. But now not able to run the build. Tried all the solutions from stackoverflow and other forums, none of them worked.
Here is my package.json
{
"name": "my-admin-frontend",
"version": "0.0.1",
"author": "",
"license": "ISC",
"scripts": {
"dev": "node server.js",
"build": "next build ./src",
"preinstall": "npx npm-force-resolutions",
"start": "npm run build && node server.js",
"coverage": "jest",
"lint": "npm run lint:js && npm run lint:styles",
"lint:js": "eslint \"./src/pages/*.js\" \"./src/components/**/*.js\" \"./src/adapters/**/*.js\" --fix",
"lint:styles": "stylelint \"./src/pages/*.js\" \"./src/components/**/*.styles.js\" \"./src/components/**/*.css\"",
"check-audit": "npm audit",
"check-quality": "npm run lint",
"eslint-report": "eslint --ext .jsx,.js -c .eslintrc.yml -o report.json ./src/components -f json",
"test": "npm run coverage -- --coverage --watchAll=false"
},
"dependencies": {
"#babel/plugin-proposal-class-properties": "^7.18.6",
"#date-io/date-fns": "^2.16.0",
"#material-ui/core": "^4.11.0",
"#material-ui/icons": "^4.11.3",
"#material-ui/lab": "^4.0.0-alpha.60",
"#material-ui/pickers": "^3.2.10",
"#microsoft/applicationinsights-web": "^2.8.9",
"#microsoft/microsoft-graph-client": "^3.0.4",
"applicationinsights": "^2.3.6",
"axios": "^1.2.1",
"body-parser": "^1.20.1",
"cookie": "^0.5.0",
"cookie-parser": "^1.4.6",
"date-fns": "^2.29.3",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.7",
"eslint-config-next": "^13.0.6",
"express": "^4.18.2",
"express-session": "^1.17.3",
"grapesjs": "^0.20.1",
"grapesjs-preset-webpage": "^1.0.2",
"helmet": "^6.0.1",
"hpp": "^0.2.3",
"identity-obj-proxy": "^3.0.0",
"jquery": "^3.6.1",
"js-cookie": "^3.0.1",
"jwt-decode": "^3.1.2",
"mobx": "^6.7.0",
"mobx-react": "^7.6.0",
"mobx-react-lite": "^3.4.0",
"next": "^13.0.6",
"next-images": "^1.8.4",
"node-fetch": "^3.3.0",
"passport": "^0.6.0",
"passport-azure-ad": "^4.3.4",
"postcss": "^8.4.19",
"prop-types": "^15.8.1",
"qrcode.react": "^3.1.0",
"react": "^18.2.0",
"react-device-detect": "^2.2.2",
"react-dom": "^18.2.0",
"react-idle-timer": "^5.4.2",
"react-player": "^2.11.0",
"react-responsive-carousel": "^3.2.23",
"react-screen-orientation": "0.0.4",
"react-test-renderer": "^18.2.0",
"styled-components": "^5.3.6"
},
"devDependencies": {
"#babel/plugin-proposal-decorators": "^7.20.5",
"#babel/plugin-proposal-optional-chaining": "^7.18.9",
"#jest/fake-timers": "29.3.1",
"#wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
"autoprefixer": "^10.4.13",
"babel-eslint": "^7.2.3",
"babel-plugin-styled-components": "^2.0.7",
"contentful-management": "^10.22.0",
"dotenv": "^16.0.3",
"eslint": "^8.29.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^8.0.2",
"jest": "^29.3.1",
"jest-enzyme": "^4.2.0",
"jest-puppeteer": "^6.1.1",
"junit-report-builder": "^3.0.1",
"pa11y-ci": "^3.0.1",
"puppeteer": "^19.4.0",
"stylelint": "^14.16.0",
"stylelint-config-recommended": "9.0.0",
"stylelint-config-styled-components": "0.1.1",
"stylelint-processor-styled-components": "1.10.0",
"tailwindcss": "^3.2.4"
},
"resolutions": {
"node-fetch": "2.6.7",
"object-path": "0.11.5",
"glob-parent": "5.1.2",
"set-value": "4.0.1",
"underscore": "1.13.2",
"ws": "7.4.6",
"jest-environment-jsdom": "27.4.6"
},
"husky": {
"hooks": {
"pre-push": "npm run check-quality"
}
},
"robots": {
"prod": {
"userAgent": [
"*"
],
"allow": [
"/"
]
},
"dev": {
"userAgent": [
"*"
],
"disallow": [
"*"
],
"noindex": [
"*"
]
}
}
}
My .eslintrc.yml
env:
browser: true
node: true
commonjs: true
es6: true
jest: true
extends:
- eslint:recommended
- plugin:react/recommended
- plugin:jsx-a11y/recommended
- next/core-web-vitals
parser: babel-eslint
parserOptions:
ecmaFeatures:
jsx: true
ecmaVersion: 2018
sourceType: module
plugins:
- react
- jsx-a11y
- react-hooks
rules:
react-hooks/rules-of-hooks:
- error
react-hooks/exhaustive-deps:
- warn
indent:
- error
- 4
semi:
- error
- never
no-console:
- error
- allow:
- error
- warn
- info
object-curly-spacing:
- error
- always
array-bracket-spacing:
- error
- never
jsx-quotes:
- error
- prefer-single
lines-between-class-members:
- error
- always
no-multiple-empty-lines:
- error
- max: 1
react/display-name:
- off
settings:
react:
version: detect
My .eslintignore
out/*
.next/*
Error I am getting is :
Linting and checking validity of types ...Error: Cannot find module 'escope'
Require stack:
C:\project test\MT-MyProject\node_modules\eslint\lib\api.js
I tried multiple changes in package.json but none worked.
I tried cleaning cache and installing all again but no luck.
have You tried to uninstall eslint library and then to try with npm i and then build

Error: `fsevents` unavailable (this watcher can only be used on Darwin) in CRA v2.1.7 and craco v3.5.0

I am getting the above error while running jest v23 in a monorepo. The package i am running jest on is built on CRA and craco.
Package.json of my CRA
{
"name": "#sprinklr/chat-web-client",
"version": "0.1.0",
"dependencies": {
"#emotion/core": "^10.0.5",
"#emotion/styled": "^10.0.5",
"#sentry/browser": "^5.8.0",
"#sentry/integrations": "^5.8.0",
"#sprinklr/chat-constants": "2.0.0",
"#sprinklr/chat-entities": "2.0.0",
"#sprinklr/chat-utils": "2.0.0",
"#sprinklr/rest-client": "2.0.0",
"azure-storage": "^2.10.3",
"bluebird": "^3.4.0",
"classnames": "^2.2.6",
"core-js": "^3.0.1",
"emotion": "^10.0.2",
"emotion-theming": "^10.0.5",
"formik": "^1.3.2",
"immutability-helper": "^2.8.1",
"jstz": "^2.1.1",
"lodash": "^4.17.4",
"polished": "^2.3.0",
"prop-types": "^15.5.7",
"react": "^16.8.6",
"react-autosize-textarea": "^6.0.0",
"react-dom": "^16.8.6",
"react-frame-component": "^4.0.2",
"react-redux": "7.2.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.7",
"react-transition-group": "^2.5.3",
"react-use": "^14.1.1",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-saga": "^1.0.1",
"reselect": "^4.0.0",
"scriptjs": "^2.5.8",
"shortid": "^2.2.14",
"styled-system": "^3.0.2",
"typesafe-actions": "^2.0.4",
"validate.js": "^0.13.1"
},
"scripts": {
"precommit": "pretty-quick --staged",
"start": "sh internals/build/build-packages.sh && craco start --workspace",
"prebuild": "NODE_ENV=production babel-node internals/build/tools/run prebuild",
"build": "sh internals/build/build.sh",
"analyze": "source-map-explorer build/static/js/main.*",
"eject": "react-scripts eject",
"docz:dev": "docz dev",
"docz:build": "docz build",
"static": "NODE_ENV=production babel-node internals/build/tools/run static/index",
"widget": "NODE_ENV=production babel-node internals/build/tools/run widget/index",
"i18n": "sh internals/i18n/index.sh",
"lint": "eslint src",
"format": "npm run prettier -- --write",
"prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"",
"validate": "npm run lint && npm run prettier -- --list-different",
"test": "craco test --workspace --env=jsdom",
"test-watch": "npm run test -- --watch",
"test-coverage": "npm run test -- --coverage",
"test-update": "npm run test -- --updateSnapshot"
},
"devDependencies": {
"#babel/cli": "7.2.3",
"#babel/core": "7.2.2",
"#babel/node": "7.2.2",
"#babel/preset-env": "^7.3.1",
"#craco/craco": "^3.5.0",
"#emotion/babel-preset-css-prop": "^10.0.7",
"#sprinklr/chat-types": "2.0.0",
"#testing-library/jest-dom": "4.2.4",
"#testing-library/react": "^9.4.0",
"#types/bluebird": "^3.5.26",
"#types/classnames": "^2.2.7",
"#types/jest": "26.0.0",
"#types/lodash": "^4.14.118",
"#types/node": "^11.13.7",
"#types/react": "^16.8.14",
"#types/react-dom": "^16.8.4",
"#types/react-intl": "^2.3.15",
"#types/react-redux": "^7.1.0",
"#types/react-router": "^4.4.2",
"#types/react-textarea-autosize": "^4.3.3",
"#types/react-transition-group": "^2.0.15",
"#types/redux-logger": "^3.0.6",
"#types/scriptjs": "^0.0.2",
"#types/shortid": "^0.0.29",
"#types/styled-system": "^3.0.8",
"aws-sdk": "^2.392.0",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-named-asset-import": "^0.2.3",
"babel-plugin-react-intl": "^3.0.1",
"babel-plugin-react-intl-auto": "^1.6.0",
"babel-preset-react-app": "^7.0.0",
"cheerio": "^1.0.0-rc.2",
"docz": "^0.12.15",
"eslint-plugin-prettier": "^2.6.2",
"glob": "^7.1.2",
"husky": "^0.14.3",
"node-sass-chokidar": "^1.3.0",
"prettier": "1.13.7",
"pretty-quick": "^1.6.0",
"react-intl": "^2.8.0",
"source-map-explorer": "^1.5.0",
"terser": "3.16.1",
"ts-jest": "26.1.1",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.16.0",
"tslint-react-hooks": "^1.1.0",
"typescript": "3.4.5",
"typescript-styled-plugin": "^0.13.0",
"webpack-merge": "^4.1.4"
},
"optionalDependencies": {
"fsevents": "1.2.4"
},
"browserslist": [
">1%",
"last 4 versions",
"Firefox ESR",
"not ie < 11"
]
}
I checked my node_modules and it has fsevents installed. Still getting the error. Most common solution which I found was reinstalling node_modules after deleting yarn.lock but this solution isn't working for me. Neither installing watchman worked.
I am using jestConfig of CRA itself
Solved this issue by installing brew and then doing
brew install watchman
on my mac.

Error during yarn build "TS2694: Namespace 'React' has no exported member 'Context'"

I am trying to build one project and am facing issues during yarn build with react router types. Project is not mine and I do not have any significant prior experience with react or typescript but I need to build it. Any help would be much appreciated, thanks.
OUTPUT:
Failed to compile.
/home/marek/devel/builds/ob1/src/webclient/node_modules/#types/react-router/index.d.ts
(141,37): error TS2694: Namespace 'React' has no exported member 'Context'.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Makefile:185: recipe for target 'webclient' failed
make: *** [webclient] Error 1
Also attaching package.json provided with the project.
package.json:
{
"name": "obelisk_miner_ui",
"version": "0.1.0",
"private": true,
"dependencies": {
"#types/classnames": "2.2.3",
"#types/enzyme": "2.8.11",
"#types/jest": "21.1.1",
"#types/lodash": "4.14.106",
"#types/loglevel": "1.5.1",
"#types/node": "8.0.31",
"#types/prop-types": "15.5.3",
"#types/react": "16.3.8",
"#types/react-dom": "16.0.5",
"#types/react-redux": "5.0.9",
"#types/react-router-dom": "4.2.7",
"#types/recharts": "1.0.23",
"#types/redux-logger": "3.0.5",
"axios": "0.17.1",
"classnames": "2.2.5",
"csx": "8.5.0",
"enzyme": "3.1.0",
"formik": "0.11.11",
"isemail": "3.0.0",
"lodash": "4.17.4",
"loglevel": "1.5.0",
"moment": "2.22.2",
"query-string": "5.1.0",
"react": "16.3.1",
"react-copy-to-clipboard": "5.0.1",
"react-dom": "16.3.1",
"react-dropzone": "4.2.13",
"react-redux": "5.0.6",
"react-router-dom": "4.3.1",
"react-scripts-ts": "2.7.0",
"react-typestyle": "0.3.0",
"recharts": "1.0.0-beta.10",
"redux": "3.7.2",
"redux-batch-enhancer": "0.1.3",
"redux-logger": "3.0.6",
"redux-logic": "0.12.3",
"reselect": "3.0.1",
"semantic-ui-css": "2.2.12",
"semantic-ui-forest-themes": "1.0.3",
"semantic-ui-react": "0.82.0",
"typescript": "2.8.1",
"typescript-fsa": "2.5.0",
"typestyle": "1.4.1",
"updeep": "1.0.0",
"valid-url": "1.0.9"
},
"resolutions": {
"#types/react": "16.3.8"
},
"devDependencies": {},
"scripts": {
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom --setupTestFrameworkScriptFile=raf/polyfill",
"eject": "react-scripts-ts eject"
},
"proxy": {
"/api": {
"target": "http://192.168.1.41"
}
}
}

React JS : Module build failed: SyntaxError: Unexpected token

I recently wanted to shift my sample app created using react-create-app to an existing React project.
I am using the react-autosuggest library to render a simple search bar.
While exporting the files to my existing react project, I get the following error:
Module build failed: SyntaxError: Unexpected token (126:11)
124 | }
125 |
> 126 | onChange = (event, { newValue }) => {
| ^
127 | this.setState({
128 | value: newValue
129 | });
BabelLoaderError: SyntaxError: Unexpected token (126:11)
124 | }
125 |
> 126 | onChange = (event, { newValue }) => {
| ^
127 | this.setState({
128 | value: newValue
129 | });
The code is part of the react-autosuggest library
The only difference I see in the projects is their devDependencies, in package.json.
Here's the package.json for the project that's working:
{
"name": "autosuggestapp",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^15.6.1",
"react-autosuggest": "^9.2.0",
"react-dom": "^15.6.1"
},
"devDependencies": {
"react-scripts": "1.0.7"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Here's the one that has the error:
{
"name": "my-app",
"version": "0.0.1",
"description": "my app",
"readme": "./README.md",
"dependencies": {
"babel-polyfill": "6.22.0",
"history": "4.5.1",
"invariant": "2.2.2",
"lodash": "4.17.4",
"node-sass": "^3.13.1",
"query-string": "4.3.1",
"react": "15.4.2",
"react-autosuggest": "^9.3.0",
"react-dom": "15.4.2",
"react-redux": "5.0.2",
"react-tooltip": "3.2.7",
"redux": "3.6.0",
"redux-saga": "0.14.3",
"reselect": "2.5.4",
"sn-http-request": "0.0.16"
},
"devDependencies": {
"babel-cli": "6.22.2",
"babel-core": "6.22.1",
"babel-eslint": "7.1.1",
"babel-loader": "6.2.10",
"babel-preset-es2015": "6.22.0",
"babel-preset-react": "6.22.0",
"babel-preset-stage-3": "6.17.0",
"case-sensitive-paths-webpack-plugin": "1.1.4",
"colors": "1.1.2",
"cross-env": "3.1.3",
"css-loader": "0.26.1",
"eslint": "3.14.1",
"eslint-loader": "1.6.1",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "3.0.2",
"eslint-plugin-react": "6.9.0",
"extract-text-webpack-plugin": "1.0.1",
"fs-extra": "0.30.0",
"glob": "7.1.1",
"jasmine-reporters": "2.2.0",
"jest": "18.1.0",
"jest-cli": "18.1.0",
"lodash-webpack-plugin": "0.11.0",
"mkdirp": "0.5.1",
"moment": "2.15.1",
"node-sass": "4.5.0",
"npm-run-all": "3.1.0",
"q": "1.4.1",
"replacestream": "4.0.2",
"sass-loader": "4.0.2",
"stringify-object": "3.1.0",
"through2": "2.0.1",
"watch": "1.0.1",
"webpack": "1.14.0",
"xml2js": "0.4.17",
"yargs": "6.0.0"
},
"repository": {
"type": "git",
"url": <my project's git url>
},
"engines": {
"node": ">=6.9.0"
},
"jest": {
"testPathIgnorePatterns": [
"/node_modules/",
"/target/"
],
"setupTestFrameworkScriptFile": "./tool/jasmine.env.js"
},
"scripts": {
"clean-target": "babel-node ./tool/build.cleanup.js",
"build:resources": "babel-node ./tool/buildResources.js",
"build:js": "babel-node ./tool/buildJs.js",
"intl": "babel-node ./tool/intl",
"build:intl": "npm-run-all build:resources intl",
"watch": "babel-node ./tool/watcher.js",
"watch-quick": "babel-node ./tool/watcher.js -q",
"prebuild": "npm run clean-target",
"build": "npm-run-all --parallel build:intl build:js",
"build:watch": "npm-run-all build:intl watch",
"start": "npm-run-all prebuild build:resources watch-quick",
"test": "echo 'Do not run jest until fixed'",
"test:watch": "npm run test -- --watch"
}
}
I think it is because you are using the Class instance fields syntax that is in stage-2, but you are using the Babel stage-3 preset (good idea to post your package.json!)
Check it out here. If you enable stage-2, you will see that the error goes away.

Resources