aws-samples / aws-samples/liveness-detection

Frontend npm install command failing - [ ERROR Failed to compile with 1 error ]

Open
#11 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
104
Forks
39
PR merge metrics
No merged PRs in 30d

Description

Hi Team,

I was checking this up and while replicating at the lab end i notice the npm error while installing the frontend.

**Step 5: Run the comamand below to build the frontend:**

`npm install && npm run build`

```
ERROR Failed to compile with 1 error

error in [internal]

INTERNAL ERROR(undefined,undefined) Cannot destructure property 'script' of 'result.descriptor' as it is undefined.
stack trace:
TypeError: Cannot destructure property 'script' of 'result.descriptor' as it is undefined.
at Object.parseComponent (/home/ec2-user/liveness-detection/client/node_modules/@vue/cli-plugin-typescript/vue-compiler-sfc-shim.js:6:13)
at Function.resolveScriptBlock (/home/ec2-user/liveness-detection/client/node_modules/fork-ts-checker-webpack-plugin/lib/VueProgram.js:196:35)
at Object.host.getSourceFile (/home/ec2-user/liveness-detection/client/node_modules/fork-ts-checker-webpack-plugin/lib/VueProgram.js:106:45)
at findSourceFile (/home/ec2-user/liveness-detection/client/node_modules/typescript/lib/typescript.js:101559:29)
at processImportedModules (/home/ec2-user/liveness-detection/client/node_modules/typescript/lib/typescript.js:101900:25)
at findSourceFile (/home/ec2-user/liveness-detection/client/node_modules/typescript/lib/typescript.js:101607:17)
at /home/ec2-user/liveness-detection/client/node_modules/typescript/lib/typescript.js:101436:85
at getSourceFileFromReferenceWorker (/home/ec2-user/liveness-detection/client/node_modules/typescript/lib/typescript.js:101403:34)
at processSourceFile (/home/ec2-user/liveness-detection/client/node_modules/typescript/lib/typescript.js:101436:13)
at processRootFile (/home/ec2-user/liveness-detection/client/node_modules/typescript/lib/typescript.js:101259:13)

ERROR Build failed with errors.
```

To get rid of the error just a quick workaround was to skip the dependency in the `packages.json ` file.

```
{
"name": "liveness-client",
"version": "1.0.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "~0.21.1",
"core-js": "~3.6.5",
"face-api.js": "~0.22.2",
"js-logger": "~1.6.0",
"uuid": "~8.1.0",
"vue": "~2.6.11",
"vue-lottie": "~0.2.1"
},
"devDependencies": {
"@types/uuid": "~8.0.0",
"@typescript-eslint/eslint-plugin": "~2.33.0",
"@typescript-eslint/parser": "~2.33.0",
"@vue/cli-plugin-babel": "~4.4.0",
"@vue/cli-plugin-eslint": "~4.4.0",
"@vue/cli-plugin-typescript": "~4.4.0",
"@vue/cli-service": "~4.4.0",
"@vue/eslint-config-prettier": "~6.0.0",
"@vue/eslint-config-typescript": "~5.0.2",
"eslint": "~6.7.2",
"eslint-plugin-prettier": "~3.1.3",
"eslint-plugin-vue": "~6.2.2",
"prettier": "~1.19.1",
"typescript": "~3.9.3",
"vue-template-compiler": "~2.6.11"
}
}
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure from the frontend setup instructions with `npm install && npm run build`. Then inspect the frontend package.json and the reported @vue/cli-plugin-typescript, fork-ts-checker-webpack-plugin, TypeScript, and vue-template-compiler versions. Done means the frontend build completes without skipping a dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.