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 2 improperly serves entry files named other than index.html

See original GitHub issue

🐛 bug report

Parcel 2 improperly serves entry files named other than index.html. If I run cli with parcel src/entry/popup/popup.html --open Shows 404 Not found instead of åctual html.

If I rename popup.html to index.html and then run cli with parcel src/entry/popup/index.html --open - all is good.

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

.babelrc - I dont have
.parcelrc:
{
  "extends": "@parcel/config-default",
  "transformers": {
    "*.{ts,tsx}": ["@parcel/transformer-typescript-tsc"]
  }
}

🤔 Expected Behavior

Should accept any entry file name

😯 Current Behavior

See bug description.

💁 Possible Solution

🔦 Context

Just building a simple html.

💻 Code Sample

src/entry/popup/popup.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <title></title>
  </head>
  <body>
    <div id="ExtnPopup">This is the popup UI</div>

    <script src="./popup.ts"></script>
  </body>
</html>

src/entry/popup/popup.ts

// empty

🌍 Your Environment

Software Version(s)
Parcel ^2.0.0-nightly.562
Parcel ^2.0.0-beta.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
avalanche1commented, Feb 4, 2021

That’s a workaround; we need a fix.

1reaction
MaffooBristolcommented, Feb 3, 2021

I had this same regression with Parcel 2. I simply added a plugin which would rewrite the output:

npm install -D parcel-namer-rewrite

.parcelrc

{
  "extends": "@parcel/config-default",
  "namers": ["parcel-namer-rewrite"]
}

package.json

  "parcel-namer-rewrite": {
    "rules": {
      "popup.html": "index.html"
    }
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

deploying problem with multiple html files. Parcel
with 1 entry point, it goes all right, but I want multiple HTML files. I've searched online commands like: "build:client": "parcel build client/ ......
Read more >
Package management basics - Learn web development | MDN
Parcel expects an index.html and an index.js file to work with, but otherwise it is very unopinionated about how you structure your project....
Read more >
CSS - Parcel
If two CSS files define the same class names, ids, custom properties, @keyframes , etc., they will potentially clash and overwrite each other....
Read more >
Zero Config JavaScript App Prototyping with ParcelJS - Auth0
Learn how to quickly prototype JavaScript apps using ParcelJS and see how Parcel's Hot Module Replacement and dev servers work.
Read more >
How to Change your Default Index Page in the htaccess file
The default order of index file names our particular servers look through is index.htm, index.html, index.php, and finally default.htm.
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