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

Unable to initialise new project. Fails with: Cannot find name 'Cheerio'. #12593

Closed
vik-y opened this issue Sep 26, 2020 · 7 comments
Closed

Comments

@vik-y
Copy link

vik-y commented Sep 26, 2020

Overview of the issue

Unable to initialise a new project with react frontend. Initialisation finishes but ./mvnw fails with an error

 ERROR  Failed to compile with 33 errors                                                                                                                                       6:28:38 AM

 error  in /project/node_modules/@types/enzyme/index.d.ts

ERROR in /project/node_modules/@types/enzyme/index.d.ts(384,15):
TS2304: Cannot find name 'Cheerio'.

Motivation for or Use Case

Initialising a new project

Reproduce the error

Steps

  • Initialise using jhipster command
  • Run ./mvnw

It fails with this error

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.10.0:npm (webpack build dev) on project testapp-1: Failed to run task: 'npm run webpack:build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]

Running npm run webpack:build fails this error TS2304: Cannot find name 'Cheerio'.

To confirm it's not related specifically to my environment I used the docker image to create a project from scratch and faced the same issue

docker pull jhipster/jhipster

# and ran these commands inside the container
   15  cd app
   17  jhipster 
   18  ./mvnw
   19  npm run webpack:build
Related issues

NA

Suggest a Fix

NA

JHipster Version(s)
app@0.0.1-SNAPSHOT /home/jhipster/app
`-- generator-jhipster@6.10.3 

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.mycompany.myapp"
    },
    "jhipsterVersion": "6.10.3",
    "applicationType": "monolith",
    "baseName": "app",
    "packageName": "com.mycompany.myapp",
    "packageFolder": "com/mycompany/myapp",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "embeddableLaunchScript": false,
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "react",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1601102189906,
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": false,
    "blueprints": []
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)

git version 2.17.1

node: v12.16.1

npm: 6.14.8

yeoman: 3.1.1

yarn: 1.22.5


##### **Browsers and Operating System**
Able to replicate this on Mac and Docker
@pascalgrimaud
Copy link
Member

Thanks for reporting this @vik-y
I confirm the issue, and it seems related to one of the dependency

@vik-y
Copy link
Author

vik-y commented Sep 26, 2020

Looks like the issue is with enzyme:

Bumping up enzyme to 3.10.7 fixes the problem for me.

"@types/enzyme": "3.10.7",

@pascalgrimaud
Copy link
Member

I don't see the issue in master branch, so for me, it's only in v6
@vik-y : would you like to provide the fix for v6.x_maintenance branch plz ?

@vik-y
Copy link
Author

vik-y commented Sep 26, 2020

@pascalgrimaud , Sure, will do that 👍

@corneliouzbett
Copy link

Looks like the issue is with enzyme:

Bumping up enzyme to 3.10.7 fixes the problem for me.

"@types/enzyme": "3.10.7",

Great quick fix. Worked for me 👍

@Tempest1000
Copy link

Looks like the issue is with enzyme:

Bumping up enzyme to 3.10.7 fixes the problem for me.

"@types/enzyme": "3.10.7",

Awesome, this fixed my issue using the web generated version that I created today. Thank you Vikas!!

@pascalgrimaud
Copy link
Member

Fixed by #12664

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

No branches or pull requests

4 participants