question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

@parcel/packager-html: Asset has no content

See original GitHub issue

๐Ÿ› bug report

After migrating from Parcel 1 (which had no errors),

parcel build ./html/prsm.html --public-url .

fails with Asset has no content error.

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

parcel build ./html/prsm.html --public-url .

no .parcelrc

./html/prsm.html has 667 lines of HTML, including links to js modules

๐Ÿค” Expected Behavior

Successful bundling, as with Parcel 1

๐Ÿ˜ฏ Current Behavior

Fails with

๐Ÿšจ Build failed.
@parcel/packager-html: Asset has no content
Error: Asset has no content
    at CommittedAsset.getContent (/Users/scs1ng/Sites/prsm/node_modules/@parcel/core/lib/CommittedAsset.js:99:15)
    at CommittedAsset.getCode (/Users/scs1ng/Sites/prsm/node_modules/@parcel/core/lib/CommittedAsset.js:107:30)
    at Asset.getCode (/Users/scs1ng/Sites/prsm/node_modules/@parcel/core/lib/public/Asset.js:204:48)
    at /Users/scs1ng/Sites/prsm/node_modules/@parcel/packager-css/lib/CSSPackager.js:77:51
    at /Users/scs1ng/Sites/prsm/node_modules/@parcel/utils/lib/PromiseQueue.js:53:30
    at PromiseQueue._runFn (/Users/scs1ng/Sites/prsm/node_modules/@parcel/utils/lib/PromiseQueue.js:106:13)
    at PromiseQueue._next (/Users/scs1ng/Sites/prsm/node_modules/@parcel/utils/lib/PromiseQueue.js:93:16)
    at PromiseQueue.run (/Users/scs1ng/Sites/prsm/node_modules/@parcel/utils/lib/PromiseQueue.js:84:12)
    at Object.package (/Users/scs1ng/Sites/prsm/node_modules/@parcel/packager-css/lib/CSSPackager.js:86:31)
    at PackagerRunner.package (/Users/scs1ng/Sites/prsm/node_modules/@parcel/core/lib/PackagerRunner.js:346:27)

๐Ÿ’ Possible Solution

Donโ€™t know

๐Ÿ”ฆ Context

๐Ÿ’ป Code Sample

package.json (extract):

"scripts": {
		"lint": "./node_modules/.bin/eslint ./js/*.js --fix --quiet",
		"pretty": "prettier --write ./html/*.html ./*.html ./js/*.js ./css/prsm.css doc/**/*.{html,css} package.json",
		"dev": "parcel ./html/prsm.html",
		"build1": "parcel build ./html/prsm.html --public-url . ",
		"clean": "rm -rf dist/* out/*"
	},
	"dependencies": {
		"@egjs/hammerjs": "^2.0.17",
		"@joeattardi/emoji-button": "^2.12.1",
		"component-emitter": "^1.3.0",
		"fast-xml-parser": "^3.17.4",
		"foodoc": "0.0.9",
		"hammerjs": "^2.0.8",
		"keycharm": "^0.3.1",
		"moment": "^2.29.1",
		"timsort": "^0.3.0",
		"uuid": "^7.0.3",
		"vis-data": "^6.6.1",
		"vis-network": "^7.10.2",
		"vis-util": "^4.3.4",
		"y-indexeddb": "^9.0.5",
		"y-websocket": "^1.3.6",
		"yjs": "^13.4.2"
	},
	"devDependencies": {
		"eslint": "^6.8.0",
		"eslint-config-prettier": "^6.15.0",
		"jsdoc": "^3.6.6",
		"parcel": "^2.0.0-nightly.438",
		"prettier": "2.0.5"
	},

๐ŸŒ Your Environment

Software Version(s)
Parcel 2.0.0-nightly.440
Node v14.15.0
npm/Yarn 6.14.8
Operating System 10.15.7

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
micrologycommented, Nov 3, 2020

Yeah! Deleting .parcel-cache/ did the trick - works now.

2reactions
mischniccommented, Feb 11, 2021

Should be fixed, try a recent nightly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML - Parcel
Parcel includes first-class support for HTML out of the box. HTML files are often the entry file that you provide to Parcel, and...
Read more >
Getting Started With Parcel. Next Generation Web App Bundler
Bundle all your assets. Parcel offers out of the box support for common project assets like JS, CSS, HTML. You do not need...
Read more >
Bundle your Web application with ParcelJS - codeburst
To bundle your project for production, you don't have to do any configuration or stress yourself, Parcel will automatically figure out all your...
Read more >
How to Bundle a Web App with Parcel.js - DigitalOcean
In this tutorial, you will use Parcel to build and bundle a small web application that contains HTML, CSS, and JavaScript files.
Read more >
parcel-bundler | Yarn - Package Manager
Out of the box support for JS, CSS, HTML, file assets, and more - no plugins to install. Automatically transforms modules using Babel,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found