scaphold-io / angular2-apollo-client-webpack-starter

A graphql ready starter kit for Angular2 using Apollo Client and Webpack. This starter kit is built to seamlessly integrate with the scaphold.io's powerful GraphQL-as-a-Service platform.
https://scaphold.io
MIT License
26 stars 6 forks source link

Lodash ambient setup errors #1

Open gsans opened 8 years ago

gsans commented 8 years ago

Great starter kit. Thanks!

I'd like to report that during npm start I experienced these errors:

ERROR in /Users/gerardsans/Desktop/Projects/graphql/angular2-apollo-client-webpack-starter/typings/globals/ambient/index.d.ts
(4,25): error TS2307: Cannot find module 'lodash/index'.

ERROR in /Users/gerardsans/Desktop/Projects/graphql/angular2-apollo-client-webpack-starter/typings/globals/ambient/index.d.ts
(5,3): error TS2300: Duplicate identifier 'export='.

ERROR in /Users/gerardsans/Desktop/Projects/graphql/angular2-apollo-client-webpack-starter/ambient.d.ts
(5,25): error TS2307: Cannot find module 'lodash/index'.

ERROR in /Users/gerardsans/Desktop/Projects/graphql/angular2-apollo-client-webpack-starter/ambient.d.ts
(6,3): error TS2300: Duplicate identifier 'export='.
vning93 commented 8 years ago

Did the app still start though? You might need to run npm install if it didn't work.

gsans commented 8 years ago

Yes, it worked but I don't like having errors on my console.

Good news is I already found a fix! :smile:

You can run:

npm run typings install lodash --ambient

Then replace angular2-apollo-client-webpack-starter/ambient.d.ts:

declare module 'lodash.has' {
  import main = require('~lodash/index');
  export = main.has;
}

with

declare module 'lodash.has' {
  import main = require('lodash');
  export = main.has;
}

I also had to comment out the same module declaration at angular2-apollo-client-webpack-starter/typings/globals/ambient/index.d.ts

vning93 commented 8 years ago

Thanks for the update!

d1b1 commented 8 years ago

Same issues, never able to get it start. Really love the vision, but the boilerplates are making the on-ramp for this service a little hard to use.

vning93 commented 8 years ago

What errors do you get after running the above commands to update the module declarations?

salmanansari14 commented 3 years ago

Great !