Skip to content

Issue with bundling mediasoup package: An unhandled Rollup error occurred #517

@Akshit1311

Description

@Akshit1311

Error:
image

Cause:
using mediasoup Device seems to be causing the issue.
image
image

Description:
When mediasoup is directly installed in a frontend nextjs app mediasoup.Device() is working but not working for the frontend pkg which is built using preconstruct, the build fails as in the above screenshot.

tsconfig:

{
  "compilerOptions": {
    "lib": ["es2017", "dom"],
    "isolatedModules": true,
    "esModuleInterop": true
  }
}

package.json

{
  "name": "web-core",
  "version": "1.0.0",
  "description": "",
  "main": "dist/web-core.cjs.js",
  "module": "dist/web-core.esm.js",
  "umd:main": "dist/web-core.umd.min.js",
  "scripts": {
    "fix": "pnpm preconstruct fix",
    "build": "pnpm preconstruct build",
    "watch": "pnpm preconstruct watch"
  },
  "keywords": [
    "huddle01",
    "web3"
  ],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.20.12",
    "@babel/preset-env": "^7.20.2",
    "@babel/preset-typescript": "^7.18.6",
    "@preconstruct/cli": "^2.3.0",
    "eslint-config-custom": "workspace:*",
    "types": "workspace:*",
    "typescript": "^4.9.5"
  },
  "preconstruct": {
    "umdName": "HuddleWebClient"
  },
  "dependencies": {
    "axios": "^1.3.3",
    "mediasoup-client": "^3.6.80",
    "nanoid": "^3.3.4",
    "socket.io-client": "^4.6.0"
  }
}
{
  "name": "web-core",
  "version": "1.0.0",
  "description": "",
  "main": "dist/web-core.cjs.js",
  "module": "dist/web-core.esm.js",
  "umd:main": "dist/web-core.umd.min.js",
  "scripts": {
    "fix": "pnpm preconstruct fix",
    "build": "pnpm preconstruct build",
    "watch": "pnpm preconstruct watch"
  },
  "keywords": [
    "huddle01",
    "web3"
  ],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.20.12",
    "@babel/preset-env": "^7.20.2",
    "@babel/preset-typescript": "^7.18.6",
    "@preconstruct/cli": "^2.3.0",
    "eslint-config-custom": "workspace:*",
    "types": "workspace:*",
    "typescript": "^4.9.5"
  },
  "preconstruct": {
    "umdName": "HuddleWebClient"
  },
  "dependencies": {
    "axios": "^1.3.3",
    "mediasoup-client": "^3.6.80",
    "nanoid": "^3.3.4",
    "socket.io-client": "^4.6.0"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions