Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML bundles must only contain one asset #10022

Open
Cornul11 opened this issue Nov 26, 2024 · 0 comments
Open

XML bundles must only contain one asset #10022

Cornul11 opened this issue Nov 26, 2024 · 0 comments

Comments

@Cornul11
Copy link

Cornul11 commented Nov 26, 2024

🐛 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant