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. http://192.168.0.179:8080.
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 gitlab.com.
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
cache:
key:
files:
- package-lock.json
paths:
- node_modules/
# Functions that should be executed before the build script is run
before_script:
- npm ci
pages:
script:
- npm run build
artifacts:
paths:
# The folder that contains the files to be exposed at the Page URL
- public
rules:
# This ensures that only pushes to the default branch will trigger
# a pages deploy
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
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?