kit: static adapter failing builds when route ends with .html

Describe the bug

Consider this app with one route: potato.html, where .html is explicitly defined in the url:

.
└── src/
    └── routes/
        └── potato.html/
            ├── +page.svelte
            └── +page.server.js

When prerendering server-side only pages with adapter-static, the following error is always encountered:

error during build:
Error: Cannot create directory build/potato.html, a file already exists at this position
    at mkdirp (file:///bug-repro/node_modules/@sveltejs/kit/src/utils/filesystem.js:11:11)
    at go (file:///bug-repro/node_modules/@sveltejs/kit/src/utils/filesystem.js:58:4)

Reproduction

Create a skeleton sveltekit project. Create a route and explicitly define the .html extension in the route. Add a server side-only page route. Try to prerender and build that page with static-adapter.

Logs

No response

System Info

System:
    OS: macOS 12.6.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 3.96 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.11.0 - ~/bin/nvm/versions/node/v18.11.0/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - ~/bin/nvm/versions/node/v18.11.0/bin/npm
  Browsers:
    Chrome: 109.0.5414.87
    Firefox: 109.0
    Safari: 16.2
  npmPackages:
    @sveltejs/adapter-static: 1.0.5 => 1.0.5 
    @sveltejs/kit: 1.2.3 => 1.2.3 
    svelte: ^3.54.0 => 3.55.0

Severity

serious, but I can work around it

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

closed by #11269