sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Error in package-solution with basic scaffolded project

Open jtgdnet opened this issue 9 years ago • 6 comments

Category

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

Expected or Desired Behavior

Executing gulp package-solution should correctly package the solution without error.

Observed Behavior

Executing gulp package-solution generates the following error;

Build target: DEBUG
[10:44:01] Using gulpfile C:\Temp\helloworld-webpart\gulpfile.js
[10:44:01] Starting gulp
[10:44:01] Starting 'package-solution'...
[10:44:01] Starting subtask 'package-solution'...
[10:44:01] Verifying configuration...
TypeError: error is not a function
    at Object.createPackage [as default] (C:\Temp\helloworld-webpart\node_module
s\@microsoft\sp-build-core-tasks\lib\packageSolution\packageSolution\createPacka
ge.js:59:9)
    at DestroyableTransform._flush (C:\Temp\helloworld-webpart\node_modules\@mic
rosoft\sp-build-core-tasks\lib\packageSolution\PackageSolutionTask.js:76:36)
    at DestroyableTransform.<anonymous> (C:\Temp\helloworld-webpart\node_modules
\through2\node_modules\readable-stream\lib\_stream_transform.js:138:49)
    at DestroyableTransform.g (events.js:292:16)
    at emitNone (events.js:86:13)
    at DestroyableTransform.emit (events.js:185:7)
    at prefinish (C:\Temp\helloworld-webpart\node_modules\through2\node_modules\
readable-stream\lib\_stream_writable.js:596:14)
    at finishMaybe (C:\Temp\helloworld-webpart\node_modules\through2\node_module
s\readable-stream\lib\_stream_writable.js:604:5)
    at endWritable (C:\Temp\helloworld-webpart\node_modules\through2\node_module
s\readable-stream\lib\_stream_writable.js:615:3)
    at DestroyableTransform.Writable.end (C:\Temp\helloworld-webpart\node_module
s\through2\node_modules\readable-stream\lib\_stream_writable.js:571:41)
    at DestroyableTransform.onend (C:\Temp\helloworld-webpart\node_modules\vinyl
-fs\node_modules\readable-stream\lib\_stream_readable.js:523:10)
    at DestroyableTransform.g (events.js:292:16)
    at emitNone (events.js:91:20)
    at DestroyableTransform.emit (events.js:185:7)
    at C:\Temp\helloworld-webpart\node_modules\vinyl-fs\node_modules\readable-st
ream\lib\_stream_readable.js:965:16
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
[10:44:01] Error - Unknown
 error is not a function
[10:44:01] Error - 'package-solution' sub task errored after 28 ms
 No manifests were found in 'dist\*.json'. Ensure a build has completed successf
ully and that paths.manifestsMatch is correct
[10:44:01] 'package-solution' errored after 31 ms
[10:44:01]
[10:44:01] ==================[ Finished ]==================
Error - Unknown
 error is not a function
Error - 'package-solution' sub task errored after 28 ms
 No manifests were found in 'dist\*.json'. Ensure a build has completed successf
ully and that paths.manifestsMatch is correct
[10:44:02] Project helloworld-webpart version: 0.0.1
[10:44:02] Build tools version: 2.5.3
[10:44:02] Node version: v6.11.2
[10:44:02] Total duration: 3.17 s
[10:44:02] Task errors: 3
[10:44:02] Error - 'undefined' errored after
 "orchestration aborted"

Steps to Reproduce

Initially I thought that this was an issue with my own environment, so the steps outlined below were carried out on a newly provisioned Windows Server 2012 R2 VM;

  1. Download Node (v6.11.2)
  2. Downgrade npm using npm install -g @npm3
  3. Install Yeoman and gulp using npm install -g yo gulp
  4. Install Yeoman SharePoint generator using npm install -g @microsoft/generator-sharepoint
  5. Create empty folder for project: C:\Temp\HelloWorld
  6. Create the web part using yo @microsoft/sharepoint (accept all the defaults)
  7. Test that the project builds using gulp build
  8. Test that the project can be packaged using gulp package-solution This errors with the information above.

jtgdnet avatar Aug 24 '17 13:08 jtgdnet

To follow up on this, I have identified that if you issue gulp bundle after point 7 in my reproduction steps above, then subsequently issue gulp package-solution it is successful and does not generate the error.

With this in mind, does this mean that the documentation is incorrect, or is this a workaround for the problem?

jtgdnet avatar Aug 29 '17 13:08 jtgdnet

The package-solution task indeed depends on the output of the bundle task, but that dependency is not explicit in the rig. I agree that it would be better if it was, but since it's been this way for some time already, I suspect it's by design.

waldekmastykarz avatar Aug 29 '17 17:08 waldekmastykarz

Hi waldekmastykarz, thanks for this, and knowing it allows me to continue dev, however, prior to updating t@microsoft/generator-sharepoint to v1.1.3 this wasn't required? I now see that v1.2.0 is released so will update accordingly, and if this is the way to do it, then I will continue as such.

jtgdnet avatar Aug 29 '17 17:08 jtgdnet

I think I've seen the same behavior in the previous releases

waldekmastykarz avatar Aug 29 '17 17:08 waldekmastykarz

We closed this issue as it had not activity within last 180 days. This is a generic process we have decided to perform for issues, which have not been explicitly marked still to be "work in progress" based on tags. We are performing this cleaning to make sure that old issues that have already been solved (but not closed) or are no longer relevant are cleaned out and make the issues more manageable. If this issue still valid, we would ask you to open a new issue and follow the guidance in the issue template related on the recommended location. We do apologize any inconveniences this might cause. Please do remember that issues in the issue lists are also messages for others in the community, so you can also check if you can assist on any of them. “Sharing is caring!”

spdevdocs avatar Apr 29 '18 12:04 spdevdocs

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

msft-github-bot avatar Jan 29 '20 00:01 msft-github-bot