Sp-dev-docs: Error when bundling solution targeting on-prem

Created on 8 Dec 2017  ยท  8Comments  ยท  Source: SharePoint/sp-dev-docs

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Be able to bundle newly created project.

Observed Behavior

When running gulp bundle on a newly created project, scaffolded using generator v1.4.0, targeting on-prem, you get the following error:

[13:04:59] Error - typescript - <undefined path>(0,0): error TS2688: Cannot find type definition file for 'es6-promise'.

Steps to Reproduce

  • scaffold new project using generator v1.4.0
  • baseline: _SharePoint 2016 onwards, including SharePoint Online_
  • other options default values
  • no JavaScript framework (the same error occurs when choosing React as framework)
  • run gulp bundle ๐Ÿ’ฅ
tooling fixed-next-drop tracked bug-suspected

All 8 comments

@nickpape-msft - can you take a look?

Had the same issue, I was able to bundle the solution after installing the type definitions for es6-promise again.
npm install --save @types/es6-promise

Looks like we have a dependency that is missing for on-prem. @joaoferreira's workaround is the correct solution. We will update the generator with this missing package.

@waldekmastykarz , are you using NPM or a different package manager to do installations? Which version of NPM are you using? Could you manually check the node_modules/@types/ folder and see if es6-promise is there?

It looks like various framework packages (including [email protected]) should be bringing @types/es6-promise as an indirect dependency, which should get resolved by your tsconfig.json. If you have a consistent repro, could you try just running another npm install after the generator is complete just to ensure all dependencies are installed?

Or even better, could you run npm list @types/es6-promise on a repro of this issue? Again, I wasn't able to repro this using [email protected]. I am trying now with [email protected].

I've just checked it and it seems like the issue occurs only on node v8 and npm v5. On node v6 with npm v4 everything works just fine. The odd thing is, that in both cases the output of the npm ls @types/es6-promise command is the same:

โ”œโ”€โ”ฌ @microsoft/[email protected]
โ”‚ โ”œโ”€โ”ฌ @microsoft/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @types/[email protected]
โ”‚ โ””โ”€โ”ฌ @microsoft/[email protected]
โ”‚   โ””โ”€โ”€ @types/[email protected]
โ”œโ”€โ”ฌ @microsoft/[email protected]
โ”‚ โ”œโ”€โ”ฌ @microsoft/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @types/[email protected]
โ”‚ โ”œโ”€โ”ฌ @microsoft/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @types/[email protected]
โ”‚ โ”œโ”€โ”ฌ @microsoft/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @types/[email protected]
โ”‚ โ”œโ”€โ”ฌ @microsoft/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @types/[email protected]
โ”‚ โ””โ”€โ”€ @types/[email protected]
โ””โ”€โ”ฌ @microsoft/[email protected]
  โ”œโ”€โ”ฌ @microsoft/[email protected]
  โ”‚ โ”œโ”€โ”ฌ @microsoft/[email protected]
  โ”‚ โ”‚ โ””โ”€โ”€ @types/[email protected]
  โ”‚ โ””โ”€โ”€ @types/[email protected]
  โ”œโ”€โ”ฌ @microsoft/[email protected]
  โ”‚ โ””โ”€โ”€ @types/[email protected]
  โ””โ”€โ”€ @types/[email protected]

Since node v8 is not officially supported at the moment, we could close this issue, but perhaps it would be helpful for you guys to track this internally when fixing support for node v8, which being LTS should be supported.

Thanks @waldekmastykarz , we will continue to track the issue internally.

@waldekmastykarz this should be working properly now.

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

byrongits picture byrongits  ยท  3Comments

acksoft picture acksoft  ยท  3Comments

waldekmastykarz picture waldekmastykarz  ยท  3Comments

jonthenerd picture jonthenerd  ยท  3Comments

bengtmoss picture bengtmoss  ยท  3Comments