Skip to content

static:generate does not warn about the Vite development server running #2060

@a-kla

Description

@a-kla

Tempest version

2.14

PHP version

8.4

Operating system

Linux

Description

Edit 2: Updated Description for more clarity.

I had Vite + Plugin installed as described in the Tempest Doc.
I tried to build a static Page:

$ ./tempest static:generate --crawl

// GENERATING STATIC PAGES
/ .............................................................................................................. 3 DEAD LINKS
Failures .................................................................................................................. 1
Static pages generated .................................................................................................... 0

// DEAD LINKS
/ ......................................................................................................................... #
/ ......................................................................................................................... #
/ ......................................................................................................................... #

TL;DR: This behavior occurs only when a node Server is running in the background (npm dev) at the same time.

Without --crawl it generates the page but the index.html includes:

<script type="module" src="http://[::]:5173/@vite/client"></script>
<script type="module" src="http://[::]:5173/src/main.entrypoint.ts"></script>
<link rel="stylesheet" href="http://[::]:5173/src/main.entrypoint.css" />

Later the same command worked as expected:

<script type="module" src="assets/main.entrypoint-BY3IQ6qW.js" />
<link rel="stylesheet" href="assets/main-BmsNWnvI.css" />

But then i got the "DEAD LINKS" again and did not see why.

Now I know: If Node is running in the background ( pnpm dev / npm run dev) this happens.
And sometimes it don't start to work again after stooping Node. Even restarting my PC and deleting .tempest/ did not help.

A minimal repository for reproduction
The last commit shows the difference between running pnpm dev and not running it.

But I don't need Vite atm and removed it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions