Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for react-scripts 3.4.0 (webpack 4.41.5) #33

Closed
Patrik-Lundqvist opened this issue Feb 21, 2020 · 6 comments
Closed

Support for react-scripts 3.4.0 (webpack 4.41.5) #33

Patrik-Lundqvist opened this issue Feb 21, 2020 · 6 comments

Comments

@Patrik-Lundqvist
Copy link

Patrik-Lundqvist commented Feb 21, 2020

The latest npm release of craco-less (1.15.0) is not compatible with the current version of CRA (3.4.0)

react-script now requires webpack 4.41.5

@tux-tn
Copy link
Collaborator

tux-tn commented Feb 21, 2020

Hello Patrick.
craco-less is now using webpackas dev dependency to prevent such version mismatch conflicts.
I am using 1.15.0 with react-scripts 3.4.0 right now and i don't have any problem running craco. Can you give more info about the issue your are encountering ? Any error message?

@tux-tn tux-tn added question Further information is requested and removed question Further information is requested labels Feb 21, 2020
@Patrik-Lundqvist
Copy link
Author

Moving webpack as a dev dependency was done after the 1.15.0 release, no?

npm still shows webpack 4.41.2 as a regular dependency

├─┬ craco-less@1.15.0
  └── webpack@4.41.2

The issue I'm encountering is in the CRA preflight check (complains about detecting webpack 4.41.2 )

@tux-tn
Copy link
Collaborator

tux-tn commented Feb 21, 2020

The commit is not included in 1.15.0 release, my bad.
The needed change (updating to webpack 4.14.5) has already been pushed to the repo but since only @ndbroadbent can push new version to npm we need to wait for a 1.16.0 release (I already notified Nathan of the changes).

You have two temporary workarounds while waiting for a new release:

  • Adding SKIP_PREFLIGHT_CHECK=true to your .env file to prevent the preflight checks from running.
  • Switching temporarily to yarn, i was not having your issue because yarn's dependencies resolution was installing the correct version.

And Sorry for the inconvenience!

@Patrik-Lundqvist
Copy link
Author

Yeah, fortunately there are easy workarounds; just thought I'd give a heads-up. No worries at all, thanks for the work you do here! 👍

@tux-tn
Copy link
Collaborator

tux-tn commented Feb 22, 2020

craco-less 1.16.0 has been released and should fix the cra preflight check warning.
Thank you @Patrik-Lundqvist for giving a heads-up about the issue

@tux-tn tux-tn closed this as completed Feb 22, 2020
@pybuche
Copy link

pybuche commented Apr 30, 2020

Hi !

Did anyone had this solved ?
I'm using both craco-less and craco-antd and I can't make the production build to start (I get the same issue as here #30), but with react-scripts 3.4.1 & webpack 4.41.5...

The weird thing is: the first build worked, but when I rebuild it, it's not working anymore :/
I'm currently trying to adapt my versions to stabilize my build but can't manage to do it correctly apparently 🤔

Here's my package.json:

{
    "name": "staycation-admin",
    "version": "1.0.0",
    "private": true,
    "description": "Staycation client UI",
    "author": "Staycation",
    "license": "ISC",
    "engines": {
        "node": "~12"
    },
    "scripts": {
        "start": "craco start",
        "build": "craco build",
        "test": "craco test",
        "lint:js": "eslint --color ./src",
        "lint:js:fix": "yarn lint:js --fix",
        "lint:sass": "sass-lint -v -q",
        "lint:sass:fix": "sass-lint-auto-fix",
        "lint": "yarn lint:sass && yarn lint:js",
        "type-check": "tsc --pretty",
        "style-check": "yarn type-check && yarn lint",
        "full-check": "yarn style-check && yarn test"
    },
    "dependencies": {
        "@ant-design/icons": "^4.0.6",
        "@craco/craco": "5.5.0",
        "@mars/heroku-js-runtime-env": "3.0.2",
        "@sentry/browser": "^5.15.4",
        "@sentry/cli": "^1.52.3",
        "@types/jest": "^25.2.1",
        "@types/node": "^13.13.2",
        "@types/react": "^16.9.34",
        "@types/react-dom": "^16.9.6",
        "antd": "4.1.4",
        "axios": "0.19.2",
        "connected-react-router": "6.8.0",
        "craco-antd": "1.14.1",
        "craco-less": "1.16.0",
        "date-fns": "2.0.0-alpha.25",
        "geolib": "^3.2.1",
        "history": "4.10.1",
        "jwt-decode": "2.2.0",
        "lodash": "^4.17.15",
        "moment": "2.24.0",
        "node-sass": "^4.13.1",
        "prop-types": "^15.7.2",
        "react": "16.13.1",
        "react-dom": "16.13.1",
        "react-photo-gallery": "8.0.0",
        "react-redux": "7.2.0",
        "react-router-dom": "5.1.2",
        "react-scripts": "3.3.1",
        "react-sortable-hoc": "1.11.0",
        "redux": "4.0.5",
        "redux-devtools-extension": "2.13.8",
        "redux-form": "8.3.5",
        "redux-saga": "1.1.3",
        "slug": "2.1.1",
        "typescript": "^3.8.3",
        "url-search-params": "^1.1.0"
    },
    "devDependencies": {
        "@types/lodash": "^4.14.149",
        "@types/react-redux": "^7.1.7",
        "@typescript-eslint/eslint-plugin": "^2.21.0",
        "@typescript-eslint/parser": "^2.21.0",
        "eslint-config-airbnb-typescript": "^5.0.0",
        "eslint-import-resolver-typescript": "^2.0.0",
        "eslint-import-resolver-webpack": "^0.9.0",
        "eslint-plugin-import": "^2.18.2",
        "eslint-plugin-jest": "21.15.1",
        "eslint-plugin-jsx-a11y": "^6.2.3",
        "eslint-plugin-lodash": "^6.0.0",
        "eslint-plugin-react": "^7.14.3",
        "eslint-plugin-react-hooks": "^1.7.0",
        "react-test-renderer": "16.8.6",
        "sass-lint-auto-fix": "^0.21.0"
    },
    "browserslist": [
        ">0.2%",
        "not dead",
        "not ie <= 11",
        "not op_mini all"
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants