Pages not showing javascript site

When I want to view the site through the site-url provided in Pages I currently get to see an empty page, indicating that no webserver is running in order to run the JavaScript code in the html-file (viewing the source code of the empty page shows that the index file is shown, but the JavaScript code is not executed).

I can view the same site locally e.g. by running in the terminal

http-server build

(with http-server installed and with the production-version of the site in subdirectory ‘build’) and then opening the provided url/port, e.g.

So I would expect that the url provided by Pages would also show the site and execute the JavaScript script on the webpage?

I’m working on

Is there some extra configuring required to make this work?

I’m not sure what information is relevant to answer the question so please just ask if I need to provide more information.

Here is the gitlab-ci.yml file. The Pipeline seems to work fine, runs with no errors.

# The Docker image that will be used to build your app
image: node:latest

# cache our package-lock and node_modules during the stages
      - package-lock.json
    - node_modules/

# Functions that should be executed before the build script is run
  - npm ci
    - npm run build
      # The folder that contains the files to be exposed at the Page URL
      - public
    # This ensures that only pushes to the default branch will trigger
    # a pages deploy

This is fragment from job pages that relates to the build script:

The site is automatically deployed to environment production. Should I somehow change how it is deployed?

This should explain what is wrong:

Seems specific for this website. Installed a Pages site according to GitLab Getting Started Tutorial and that worked fine.

Ideas as to how to solve the issue are nevertheless welcome.