pnp / sp-dev-solutions

Repository for SharePoint development reusable solutions
Other
496 stars 442 forks source link

LinksAndHandlebarsTemplate cant build #133

Open chinthaka321 opened 5 years ago

chinthaka321 commented 5 years ago

Category

When above commands run solution should run without any issues.

Observed Behavior

ran npm install didn't download files to node_modules folder Had to remove package-lock.json to run npm install then ran gulp build and it gave following errors.

[16:10:16] Error - [tsc] src/webparts/handlebarTemplateDisplay/HandlebarTemplateDisplayWebPart.ts(112,17): error TS2322: Type 'TemplateSpecification' is not assignable to type 'string'. [16:10:16] Error - [tsc] src/webparts/handlebarTemplateDisplay/HandlebarTemplateDisplayWebPart.ts(170,15): error TS2322: Type 'TemplateSpecification' is not assignable to type 'string'. [16:10:16] Error - 'tsc' sub task errored after 3.93 s exited with code 2 [16:10:16] 'build' errored after 5.71 s

rror - [tsc] src/webparts/handlebarTemplateDisplay/HandlebarTemplateDisplayWebPart.ts(112,17): error TS2322: Type 'TemplateSpecification' is not assignable to type 'string'. Error - [tsc] src/webparts/handlebarTemplateDisplay/HandlebarTemplateDisplayWebPart.ts(170,15): error TS2322: Type 'TemplateSpecification' is not assignable to type 'string'. Error - 'tsc' sub task errored after 3.93 s exited with code 2

Steps to Reproduce

Downloaded the code npm install gulp build

Package.json { "name": "hub-web-parts", "version": "1.2.0", "private": true, "engines": { "node": ">=0.10.0" }, "dependencies": { "react": "15.6.2", "react-dom": "15.6.2", "@types/react": "15.6.6", "@types/react-dom": "15.5.6", "@microsoft/sp-core-library": "1.6.0", "@microsoft/sp-webpart-base": "1.6.0", "@microsoft/sp-lodash-subset": "1.6.0", "@microsoft/sp-office-ui-fabric-core": "1.6.0", "@microsoft/sp-http": "~1.6.0", "@microsoft/sp-loader": "~1.6.0", "@types/webpack-env": "1.13.1", "@types/es6-promise": "0.0.33", "@pnp/spfx-property-controls": "^1.9.0", "deep-diff": "^0.3.8", "handlebars": "^4.0.10", "linqts": "^1.8.2", "npm": "^6.1.0", "sp-pnp-js": "^3.0.7" }, "devDependencies": { "@microsoft/sp-build-web": "1.6.0", "@microsoft/sp-module-interfaces": "1.6.0", "@microsoft/sp-webpart-workbench": "1.6.0", "tslint-microsoft-contrib": "~5.0.0", "gulp": "~3.9.1", "@types/chai": "3.4.34", "@types/mocha": "2.2.38", "ajv": "~5.2.2", "es6-promise": "^4.2.4", "file-saver": "^1.3.3", "moment": "^2.18.1" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" } }

juliemturner commented 5 years ago

Best bet is to remove both package-lock.json and the node_modules folder and then do an npm install.

wobba commented 5 years ago

npm dedupe should suffice instead of deleting the node_modules folder after npm install.

chinthaka321 commented 5 years ago

I made source code path more shorter and did the npm install it worked. But now i'm getting following error when I do npm build . It seems typescript error.

Error - [tsc] src/webparts/handlebarTemplateDisplay/HandlebarTemplateDisplayWebPart.ts(112,17): error TS2322: Type 'TemplateSpecification' is not assignable to type 'string'. Error - [tsc] src/webparts/handlebarTemplateDisplay/HandlebarTemplateDisplayWebPart.ts(170,15): error TS2322: Type 'TemplateSpecification' is not assignable to type 'string'. Error - 'tsc' sub task errored after 6.94 s exited with code 2 [07:40:19] Project hub-web-parts version:1.2.0 [07:40:19] Build tools version:3.8.8 [07:40:19] Node version:v10.15.3 [07:40:19] Total duration:14 s [07:40:19] Task warnings:106 [07:40:19] Task errors:3

Have you guys faced this error before. Is this due to my Node version?

chinthaka321 commented 5 years ago

In the page https://github.com/SharePoint/sp-dev-solutions/tree/master/solutions/LinksAndHandlebarsTemplate prerequisites section its asking for to download camljs. Do we really need it? if then what are the steps I can integrate camaljs to the solution.

Prerequisites Note that you will need to download and host a CAMLJS javascript library (https://github.com/andrei-markeev/camljs/blob/master/CamlJs/camljs.js).