angular2-apollo-client-webpack-starter icon indicating copy to clipboard operation
angular2-apollo-client-webpack-starter copied to clipboard

Lodash ambient setup errors

Open gsans opened this issue 8 years ago • 6 comments

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='.

gsans avatar Jul 31 '16 20:07 gsans

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

vning93 avatar Jul 31 '16 20:07 vning93

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

gsans avatar Jul 31 '16 20:07 gsans

Thanks for the update!

vning93 avatar Aug 02 '16 05:08 vning93

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.

d1b1 avatar Sep 08 '16 12:09 d1b1

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

vning93 avatar Sep 08 '16 15:09 vning93

Great !

salmanansari14 avatar Apr 20 '21 12:04 salmanansari14