dapr / dapr/js-sdk

DAPR Workflow in JS SDK Fails When Minified Using Webpack

Open
#675 0 comments 0 reactions 0 assignees View on GitHub
area/workflow
Dominant language
JavaScript
Stars
217
Forks
104
PR merge metrics
No merged PRs in 30d

Description

Expected Behaviour
Should be able to minify a JS file (through say webpack) which makes use of Workflow SDK.

Actual Behaviour

![Image](https://github.com/user-attachments/assets/ff964791-d4c4-4fe0-a264-5aa0bb881765)

Workflow SDK in JS cannot deal with the minifed js file.

Steps to Reproduce the Problem
1.) Build sample DAPR based workflow (https://docs.dapr.io/developing-applications/sdks/js/js-workflow/)
2.) npm install --save-dev webpack webpack-cli terser-webpack-plugin
3.) Build a webpack config file:

// filepath: webpack.config.js
const TerserPlugin = require('terser-webpack-plugin');

module.exports = {
mode: 'production',
entry: './src/index.js', // Replace with the path to your main JS file
output: {
filename: 'bundle.min.js', // The output file name
path: __dirname + '/dist', // The output directory
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
};

4.) run webpack
npx webpack

5.) try to rerun dapr workflow js code thats been minified

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.