Skip to content

Cannot serve static assets created via "parcel build src/index.html" #2624

@mateja176

Description

@mateja176

🐛 bug report

App works perfectly when running locally using parcel src/index.html, however after creating a production bundle by running parcel build src/index.html and attempting to serve the static assets using vscode live serve or serve the app is being served with missing CSS and JavaScript files. The same thing happens when the app is served via github pages. Interestingly enough, http-serve is able to serve the app in its entirety. The repository containing whole source code can be found here

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

package.json

🤔 Expected Behavior

App is being served including CSS and JavaScript files.

😯 Current Behavior

App is served without CSS and JavaScript assets

Errors when accessing page served by github

src.184de31a.css:1 Failed to load resource: the server responded with a status of 404 ()
src.152c138c.js:1 Failed to load resource: the server responded with a status of 404 ()
src.184de31a.css:1 Failed to load resource: the server responded with a status of 404 ()

💁 Possible Solution

Changing the mime types of CSS and JavaScript assets

💻 Code Sample

The repository containing whole source code can be found here

🌍 Your Environment

Software Version(s)
Parcel 1.11.0
Node 10.7.0
npm/Yarn 6.5.0
Operating System Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions