Skip to content

Javascript bundles referenced with invalid absolute paths in "index.html" when building app #1572

Closed
@TAGC

Description

@TAGC

Version

3.0.0-rc.1

Reproduction link

TAGC/vue-expandable-grid@fe08cb8

Steps to reproduce

After cloning and installing dependencies, run $ ./node_modules/.bin/vue-cli-service build ./src/index.ts in the project root directory. This should generate dist/index.html and app/vendor bundles under dist/js. Open dist/index.html in a browser and confirm it gets 404s trying to load the bundles.

What is expected?

dist/index.html to be generated where it references the bundles as relative paths:

<body>
    <div id=app></div>
    <script src=./js/chunk-vendors.0676a3e4.js></script>
    <script src=./js/app.1196cf87.js></script>
</body>

What is actually happening?

The HTML file gets generated referencing the bundles at invalid absolute paths:

<body>
    <div id=app></div>
    <script src=/js/chunk-vendors.0676a3e4.js></script>
    <script src=/js/app.1196cf87.js></script>
</body>

Manually changing the absolute paths to relative paths after generating the HTML file causes the JS bundles to be loaded successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions