parcel icon indicating copy to clipboard operation
parcel copied to clipboard

XML bundles must only contain one asset

Open Cornul11 opened this issue 1 year ago • 1 comments

🐛 bug report

While trying to build a project which imports two XML files, I get an unexpected AssertionError.

🎛 Configuration (.babelrc, package.json, cli command)

{
  "name": "project_name",
  "version": "1.0.0",
  "description": "",
  "source": "src/index.html",
  "scripts": {
    "start": "parcel src/index.html",
    "build": "parcel build src/index.html --dist-dir dist"
  },
  "private": true,
  "dependencies": {
    "leaflet": "^1.9.4",
    "leaflet-arrowheads": "^1.4.0",
    "leaflet-geometryutil": "^0.10.3",
    "leaflet-polylinedecorator": "^1.6.0"
  },
  "devDependencies": {
    "@parcel/packager-xml": "^2.13.2",
    "@parcel/transformer-xml": "^2.13.2",
    "parcel": "^2.13.2",
    "svgo": "^3.3.2"
  }
}

🤔 Expected Behavior

The build should succeed.

😯 Current Behavior

I get the following error message:

npm run build

> [email protected] build
> parcel build src/index.html --dist-dir dist

× Build failed.

@parcel/packager-xml: XML bundles must only contain one asset

  AssertionError [ERR_ASSERTION]: XML bundles must only contain one asset
      at Object.package (F:\pet_projects\project_name\node_modules\@parcel\packager-xml\lib\XMLPackager.js:46:23)
      at PackagerRunner.package (F:\pet_projects\project_name\node_modules\@parcel\core\lib\PackagerRunner.js:267:27)
      at async PackagerRunner.getBundleResult (F:\pet_projects\project_name\node_modules\@parcel\core\lib\PackagerRunner.js:227:20)
      at async PackagerRunner.getBundleInfo (F:\pet_projects\project_name\node_modules\@parcel\core\lib\PackagerRunner.js:215:9)
      at async PackagerRunner.run (F:\pet_projects\project_name\node_modules\@parcel\core\lib\PackagerRunner.js:126:107)
      at async Child.handleRequest (F:\pet_projects\project_name\node_modules\@parcel\workers\lib\child.js:203:9)

💻 Code Sample

Part of map.js:

import currentPathXML from '../current_path.xml';
import predictedPathXML from '../predicted_path.xml';

The xml files are located in the src folder, while the js files are located in src/js.

🌍 Your Environment

Software Version(s)
Parcel 2.13.2
Node v20.10.0
npm/Yarn 10.2.3
Operating System Windows 11

Cornul11 avatar Nov 26 '24 00:11 Cornul11

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

github-actions[bot] avatar Jun 06 '25 12:06 github-actions[bot]