Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gulp bundle not finishing when using gulp-nodemon #189

Open
sambilfinger opened this issue Jun 21, 2023 · 0 comments
Open

Gulp bundle not finishing when using gulp-nodemon #189

sambilfinger opened this issue Jun 21, 2023 · 0 comments

Comments

@sambilfinger
Copy link

sambilfinger commented Jun 21, 2023

When trying to bundle and package-solution in gulp (using SharePoint Framework and express.js) to create a web part these functions don't work. gulp bundle --ship just does not end as I am using gulp-nodemon as a server for express and it is constantly 'Listening on port 5000'.

It is giving me the below error when trying to package-solution --ship 'Error - [package-solution] No manifests were found in 'C:\SPFX Projects.../manifests'. Ensure a build has completed successfully'. Obviously because the gulp bundle wasn't able to complete.

So when running gulp bundle --ship it does not end saying it's still 'Listening on port 5000'. How do I get around this so I can bundle and package my solution? Here is my gulpfile.js:

"use strict";

const build = require("@microsoft/sp-build-web");
const gulp = require("gulp");
const nodemon = require("gulp-nodemon");

build.addSuppression(
  `Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`
);

var getTasks = build.rig.getTasks;
build.rig.getTasks = function () {
  var result = getTasks.call(build.rig);

  result.set("serve", result.get("serve-deprecated"));

  return result;
};

/* fast-serve */
const { addFastServe } = require("spfx-fast-serve-helpers");
addFastServe(build);
/* end of fast-serve */

let serverSubTask = build.subTask(
  "server",
  function (gulp, buildOptions, done) {
    nodemon({
      script: "server.js",
      ext: "js html",
      env: { NODE_ENV: "development" },
      done: done,
    });
  }
);

build.rig.addPostBuildTask(serverSubTask);

build.initialize(require("gulp"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant