diff --git a/package-lock.json b/package-lock.json index ef501d7..a8a3c09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -242,6 +242,11 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "Buffer": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/Buffer/-/Buffer-0.0.0.tgz", + "integrity": "sha1-gs+OmGohCf9tHW8cQ25H0HEnrqQ=" + }, "acorn": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.5.tgz", diff --git a/package.json b/package.json index 2279fbd..8e3c284 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "author": "Gareth Emslie", "license": "MIT", "dependencies": { + "Buffer": "0.0.0", "azure-devops-extension-api": "^1.158.0", "azure-devops-extension-sdk": "^2.0.11", "csvtojson": "^2.0.10", diff --git a/src/import-csv-discussions-action.ts b/src/import-csv-discussions-action.ts index c41e3c8..e2dd8dc 100644 --- a/src/import-csv-discussions-action.ts +++ b/src/import-csv-discussions-action.ts @@ -211,10 +211,15 @@ class ImportCSVDiscussionsAction implements IContributedMenuSource { this._logger.info(`Ended Import.`); }); } + else + { + alert("Unable to parse CSV file contents.") + this._logger.error("Unable to parse CSV file contents."); + } } else { - alert("Error : CSV File is Empty.") - this._logger.error("Error : CSV File is Empty."); + alert("CSV File is Empty.") + this._logger.error("CSV File is Empty."); } } }; diff --git a/webpack.config.js b/webpack.config.js index 5fce2d9..4829db7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -38,11 +38,17 @@ module.exports = { }, resolve: { extensions: [ '.html', '.ts', '.js' ], + fallback: { + "buffer": require.resolve("buffer/") + } }, output: { path: path.resolve(__dirname, 'dist'), filename: '[name].js', }, plugins: [ + new webpack.ProvidePlugin({ + Buffer: ['buffer', 'Buffer'], + }) ] }; \ No newline at end of file