admin管理员组

文章数量:1366372

In my work shopware project I build the storefront and administration, the storefront loads with only html no styling applied, checking the source code it shows that it's trying to use:

/theme/f8a7b9a4e5582a69b04ec3de11ef1cdf/css/all.css

but visiting that file shows 404

This is my build storefront script description, i pasted the code on chatgpt and told it to describe it since i don't know if i can share code.

This is a bash script designed to handle various tasks related to building and installing dependencies for a Shopware project, specifically for its storefront. Here's a breakdown of the script's functionality:

Key Variables:
CWD: Stores the current working directory of the script.

PROJECT_ROOT: The root directory of the project, or a fallback value is set if PROJECT_ROOT is not already defined.

STOREFRONT_ROOT: Path to the storefront directory within the project, or a fallback if STOREFRONT_ROOT is not defined.

BIN_TOOL: Path to the binary tool (console), or ci if running in a continuous integration (CI) environment.

Script Breakdown:
Project Setup:

If the script is running in a CI environment, it switches BIN_TOOL to a ci binary and makes it executable.

Sets PROJECT_ROOT and STOREFRONT_ROOT based on the current working directory and defined variables.

Build the Storefront:

The script checks if the SHOPWARE_SKIP_BUNDLE_DUMP environment variable is not set. If not, it runs bundle:dump to prepare any bundles.

The feature:dump command is executed with an empty DATABASE_URL.

Install npm Dependencies for Plugins:

If the jq command-line tool is installed, it reads the var/plugins.json file, extracts plugin information (such as path and technical name), and installs npm dependencies for each plugin that needs it.

It installs dependencies by running npm clean-install if a package-lock.json file exists or npm install otherwise.

If jq is not installed, a message is printed saying that it can't check for required npm installations.

Storefront npm Setup:

The script installs npm dependencies for the storefront using the clean-install command.

It runs a custom script (copy-to-vendor.js) that likely handles copying necessary storefront files to the vendor directory.

It runs the npm run production command to build the production assets for the storefront.

Asset Installation:

If SHOPWARE_SKIP_ASSET_COPY is not set, it runs asset:install to install the necessary assets.

Theme Compilation:

If command-line arguments are provided, it runs the theme:compile command with the specified theme (-s option).

If no arguments are passed, it runs theme:compile without any arguments.

Purpose:
This script automates the process of setting up a Shopware storefront project, including managing npm dependencies for plugins and the storefront itself, preparing assets, and compiling the theme. It provides flexibility for both local development and CI environments.

Let me know if you need further clarification!

In my work shopware project I build the storefront and administration, the storefront loads with only html no styling applied, checking the source code it shows that it's trying to use:

https://to-d2c-shop.ddev.site/theme/f8a7b9a4e5582a69b04ec3de11ef1cdf/css/all.css

but visiting that file shows 404

This is my build storefront script description, i pasted the code on chatgpt and told it to describe it since i don't know if i can share code.

This is a bash script designed to handle various tasks related to building and installing dependencies for a Shopware project, specifically for its storefront. Here's a breakdown of the script's functionality:

Key Variables:
CWD: Stores the current working directory of the script.

PROJECT_ROOT: The root directory of the project, or a fallback value is set if PROJECT_ROOT is not already defined.

STOREFRONT_ROOT: Path to the storefront directory within the project, or a fallback if STOREFRONT_ROOT is not defined.

BIN_TOOL: Path to the binary tool (console), or ci if running in a continuous integration (CI) environment.

Script Breakdown:
Project Setup:

If the script is running in a CI environment, it switches BIN_TOOL to a ci binary and makes it executable.

Sets PROJECT_ROOT and STOREFRONT_ROOT based on the current working directory and defined variables.

Build the Storefront:

The script checks if the SHOPWARE_SKIP_BUNDLE_DUMP environment variable is not set. If not, it runs bundle:dump to prepare any bundles.

The feature:dump command is executed with an empty DATABASE_URL.

Install npm Dependencies for Plugins:

If the jq command-line tool is installed, it reads the var/plugins.json file, extracts plugin information (such as path and technical name), and installs npm dependencies for each plugin that needs it.

It installs dependencies by running npm clean-install if a package-lock.json file exists or npm install otherwise.

If jq is not installed, a message is printed saying that it can't check for required npm installations.

Storefront npm Setup:

The script installs npm dependencies for the storefront using the clean-install command.

It runs a custom script (copy-to-vendor.js) that likely handles copying necessary storefront files to the vendor directory.

It runs the npm run production command to build the production assets for the storefront.

Asset Installation:

If SHOPWARE_SKIP_ASSET_COPY is not set, it runs asset:install to install the necessary assets.

Theme Compilation:

If command-line arguments are provided, it runs the theme:compile command with the specified theme (-s option).

If no arguments are passed, it runs theme:compile without any arguments.

Purpose:
This script automates the process of setting up a Shopware storefront project, including managing npm dependencies for plugins and the storefront itself, preparing assets, and compiling the theme. It provides flexibility for both local development and CI environments.

Let me know if you need further clarification!
Share Improve this question asked yesterday Gjergj KadriuGjergj Kadriu 5984 silver badges10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I assume you have a problem when building a theme. Please deactivate unnecessary plugins/extensions to troubleshoot theme build issues and facilitate verification.

1. Use ddev ssh to check the public\theme folder:

  • Hashed theme folder containing CSS and JS files

  • Sales Channel theme ID containing other assets

Verify the hash folder matches ../theme/.../css/all.css. (The hash folder will be generated new when you change the theme)

2. If it does not exist or match, rerun ./bin/build-storefront.sh within your container and identify any issues during the build process. The expected outcome is completing assets:install, theme:compile, and cache:clear.

You can run separate commands such as php bin/console assets:install

本文标签: Theme allcss file on shopware 64120 shows 404page rendered without stylesStack Overflow