Open mohammadamer opened 3 months ago
What does your serve.json look like?
The default:
'use strict';
const build = require('@microsoft/sp-build-web');
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;
};
build.initialize(require('gulp'));
Sorry, accidently past the gulp.js serve.json file same as the code sample.
Same as the sample, i.e. untouched? Or did you populate your own values?
Same as the sample and populate with my own values. I think I figured out where is the issue.
The issue has been resolved locally by adding the following function in the gulp.js file but it hasn't been resolved when deploying the extension using Azure DevOps pipelines.
So, gulp bundle in DevOps pipeline is giving the previous error however it works locally fine. gulp bundle --ship
build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {
generatedConfiguration.module.rules.push(
{
test: /\.js$/,
exclude: /node_modules\/(?!htmlparser2)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
);
return generatedConfiguration;
}
});
Same as the sample and populate with my own values. I think I figured out where is the issue.
The issue has been resolved locally by adding the following function in the gulp.js file but it hasn't been resolved when deploying the extension using Azure DevOps pipelines.
So, gulp bundle in DevOps pipeline is giving the previous error however it works locally fine. gulp bundle --ship
build.configureWebpack.mergeConfig({ additionalConfiguration: (generatedConfiguration) => { generatedConfiguration.module.rules.push( { test: /\.js$/, exclude: /node_modules\/(?!htmlparser2)/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'] } } } ); return generatedConfiguration; } });
Can you open a new issue so I could investigate Azure DevOps support (can't commit to a timeline though)
Suggest improvements to the code sample and/or setup guide.
I did setup an SPFx extension with the same package.json packages and same components but I got error with running locally with gulp serve. I tried uninstall the packages then install again but still the same issue. Didn't find something useful when search for the errors.