HTML bundles must only contain one asset
See original GitHub issue❔ Question
Has there been any changes to parcel from 1->2 which disable usage of different kind of file extensions in one file? Maybe somebody know what exactly this message wants to tell me so i can change it? unsure if this is a bug or just me.
🔦 Context
My Project uses pug and ES6 imports.
I would get you more info but “–log-level verbose” gives me the same error using this:
parcel index.pug --log-level verbose
V1 compiled fine, i changed to V2 to get ES6 imports working because script(defer='', type="module", src='/js/main.js')
seem to not be loaded correctly in broswer because of pracelRequire.
I tried streamlining so i only use one kind of asset per type (sass => scss for ex.) didnt change the error for me.
💻 Code Sample
ben@EdenTheFourthVII:~/Projekte/Kunde/Heimatvoll/Server2/frontend$ parcel index.pug
Server running at http://localhost:1234
🚨 @parcel/packager-html: HTML bundles must only contain one asset
AssertionError [ERR_ASSERTION]: HTML bundles must only contain one asset
at Object.package (/home/ben/.nvm/versions/node/v12.10.0/lib/node_modules/parcel/node_modules/@parcel/packager-html/lib/H
TMLPackager.js:34:21)
at PackagerRunner.package (/home/ben/.nvm/versions/node/v12.10.0/lib/node_modules/parcel/node_modules/@parcel/core/lib/Pa
ckagerRunner.js:214:36)
at async PackagerRunner.getBundleResult (/home/ben/.nvm/versions/node/v12.10.0/lib/node_modules/parcel/node_modules/@parc
el/core/lib/PackagerRunner.js:182:20)
at async PackagerRunner.packageAndWriteBundle (/home/ben/.nvm/versions/node/v12.10.0/lib/node_modules/parcel/node_modules
/@parcel/core/lib/PackagerRunner.js:151:9)
at async Child.handleRequest (/home/ben/.nvm/versions/node/v12.10.0/lib/node_modules/parcel/node_modules/@parcel/workers/
lib/child.js:162:9)
🌍 Your Environment
Software | Version(s) |
---|---|
Parcel | 2.0.0-alpha.3.2 |
Node | 12.10.0 |
npm/Yarn | npm@6.10.3 |
Operating System | KDE Neon (User:18) |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:23 (9 by maintainers)
Top Results From Across the Web
HTML - Parcel
While other assets referenced from an HTML file will include a content hash ... are also processed just like standalone files, and the...
Read more >Asset Bundles - UserFrosting Documentation
Asset bundles allow you to group one or more asset references for reuse throughout your application.
Read more >Bundling and Minification | Microsoft Learn
Bundling is a new feature in ASP.NET 4.5 that makes it easy to combine or bundle multiple files into a single file. You...
Read more >AssetBundles - Unity - Manual
An AssetBundle is an archive file that contains platform-specific non-code Assets (such as Models, Textures, Prefabs, Audio clips, and even entire Scenes) ...
Read more >How to Bundle a Simple Static Site Using Webpack - SitePoint
Run npm run build again to recreate the bundle. Everything should work as before. Now, if you have a look at index.html you'll...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m getting the same error with the default scenario:
index.html
If I remove the css from
index.html
and import it inindex.jsx
withimport "./index.css"
, it works as intended.Env
Hi, @devongovett! I know https://github.com/parcel-bundler/parcel/pull/6574 fixed this issue, but why does Parcel add that inline
<script>
to the html, as mentioned here in https://github.com/parcel-bundler/parcel/issues/3875#issuecomment-864510847?