Skip to content

adapter-static: prevent generated files and directories from beginning with underscore (for github pages) #4378

@pjebs

Description

@pjebs

Describe the bug

I have a public repo: https://github.com/rocketlaunchr/petersir
It has github pages setup with a custom domain: petersir.com

My svelte config file looks like this:

import { optimizeImports } from 'carbon-preprocess-svelte';
import adapter from '@sveltejs/adapter-static';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: [optimizeImports()],
  kit: {
    adapter: adapter({
      fallback: '404.html'
    }),
    files: {
      assets: 'src/static'. /// <--------- used to copy favicon files to root directory after running build command. 
    },
    trailingSlash: 'always'
  }
};

When I go to the site: https://petersir.com, the page is blank.
When I look in the console it shows 404 errors for the crucial JS files (despite definitely existing):

image

However, the browser fetches the favicon file which is located in the root directory

Reproduction

See above:

The repo is public: https://github.com/rocketlaunchr/petersir

Logs

GET https://petersir.com/ 404
petersir.com/:11          GET https://petersir.com/_app/assets/vendor-8149caf7.css net::ERR_ABORTED 404
petersir.com/:1          GET https://petersir.com/_app/start-2f6645ce.js net::ERR_ABORTED 404
petersir.com/:1          GET https://petersir.com/_app/chunks/vendor-92f0db20.js net::ERR_ABORTED 404
petersir.com/:1          GET https://petersir.com/_app/chunks/preload-helper-e4860ae8.js net::ERR_ABORTED 404
petersir.com/:1          GET https://petersir.com/_app/chunks/singletons-d1fb5791.js net::ERR_ABORTED 404


### System Info

```shell
System:
    OS: macOS 12.1
    CPU: (8) arm64 Apple M1
    Memory: 156.61 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.4.1 - /usr/local/bin/node
    npm: 8.5.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 99.0.4844.74
    Safari: 15.2


### Severity

blocking all usage of SvelteKit

### Additional Information

github pages seems to be set up correctly: for example, the favicon is being pulled properly.

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