shyim / shopware-docker

Easy to use Docker Installation for Shopware 5 and Shopware 6
MIT License
115 stars 27 forks source link

Storefront Watch Invalid Url #173

Closed Vogeslu closed 1 year ago

Vogeslu commented 1 year ago

I just created a new project with the most recent version 6.4.16.1 (production template) and used both commands swdc storefront-init [name] and swdc storefront-watch [name]

I received following log:

Installing Node v12.22.12 (x64)
warning: Version already installed at "/nvm/.fnm/node-versions/v12.22.12"
Using Node v12.22.12 
Using Node v16.18.0 
> sw-next-storefront@1.0.0 hot-proxy    
> NODE_ENV=development MODE=hot node ./build/start-hot-reload.js        

⚠️  The feature dump file "config_js_features.json" cannot be found. All features will be deactivated. Please execute bin/console feature:dump.  ⚠️ 

# Webpack Plugin Injector: Plugin "Storefront" injected as a new entry point          

✔ Shopware 6 Storefront      
Compiled successfully in 13.64s     

ℹ 「wds」: Project is running at http://127.0.0.1:9999/     
ℹ 「wds」: webpack output is served from undefined/     
ℹ 「wds」: Content not from webpack is served from 
/var/www/html/[name]/vendor/shopware/storefront/Resources/app/storefront/dist  
Starting the hot reload server:     

Browserslist: caniuse-lite is outdated. Please run:  
npx browserslist@latest --update-db   

Why you should do it regularly:   
https://github.com/browserslist/browserslist#browsers-data-updating 

DONE  Compiled successfully in 13645ms                                                                                             9:45:07 PM 

node:internal/errors:478
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:387:5)
    at URL.onParseError (node:internal/url:565:9)
    at new URL (node:internal/url:641:5)
    at /var/www/html/name]/vendor/shopware/storefront/Resources/app/storefront/build/start-hot-reload.js:9:22
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  input: '',
  code: 'ERR_INVALID_URL'
}

Steps to reproduce the behavior:

  1. Create project swdc create-project [name]
  2. Choose Production Template with 6.4.16.1
  3. cd into project directory
  4. run swdc storefront-init [name]
  5. run swdc storefront-watch [name]

Expected behavior A working watcher with a watcher url similar to administration http://0.0.0.0:1234, a webpack output which is not undefined and of course no error

Environment:

shyim commented 1 year ago

How does your .config/swdc/env look like?

Vogeslu commented 1 year ago

Oops, forgot about this, sorry:


# Choose between docker and local
RUN_MODE=docker

# Local Settings
NGINX_VIRTUAL_HOST_DIR=/opt/homebrew/etc/nginx/servers/
NGINX_RESTART_CMD="brew services restart nginx"

# Default domain. Each folder will be an subdomain of this domain
DEFAULT_DOMAIN="dev.localhost"

# Default services domain (for adminer, elasticsearch)
DEFAULT_SERVICES_DOMAIN="localhost"

# Use ssl as default
USE_SSL_DEFAULT=false

# Persistent Database?
PERSISTENT_DATABASE=true

# Default mysql host
DEFAULT_MYSQL_HOST=mysql

# Will delegate some folders like /var/cache to the machine
# and will cache folders like /media on the host
CACHE_VOLUMES=false

# Elasticsearch
ENABLE_ELASTICSEARCH=false

ELASTICSEARCH_IMAGE="blacktop/elasticsearch:7.10"
KIBANA_IMAGE="blacktop/kibana:7.10"

# Redis
ENABLE_REDIS=false

# S3 compatible Server
ENABLE_MINIO=false

# Possible values are 7.1, 7.2, 7.3, 7.4, 8.0, 8.1
PHP_VERSION=7.4

# Possible values are ghcr.io/shyim/shopware-docker/mysql:57, ghcr.io/shyim/shopware-docker/mysql:8 for MySQL configured versions
# Also possible offical images like mysql:X mariadb:X
MYSQL_VERSION=ghcr.io/shyim/shopware-docker/mysql:8

# Expose mysql port to host
EXPOSE_MYSQL_LOCAL=true

# Http port
HTTP_PORT=80

# Https port
HTTPS_PORT=443

# Possible values are adminer / phpmyadmin
DATABASE_TOOL=adminer

# Selenium Server
ENABLE_SELENIUM=false

# Cypres support
ENABLE_CYPRESS=false

# Source code root directory
CODE_DIRECTORY="$HOME/Code"

# Blackfire configurations
ENABLE_BLACKFIRE=false
BLACKFIRE_SERVER_ID=
BLACKFIRE_SERVER_TOKEN=
BLACKFIRE_CLIENT_ID=
BLACKFIRE_CLIENT_TOKEN=

# Varnish
ENABLE_VARNISH=false

# Enable WSL XDebug Tunnel. This is the ugglyst hack ever I did to get something running. PhpStorm Traffic will be fowarded as socket to the nginx container. The socat inside the container will make it available at port 9050 inside the container. XDebug will use that port to connect to PhpStorm
WSL_XDEBUG_TUNNEL=false

# Configure this if you want to move the mysql data into a different directory, default to swdc dir
# MYSQL_DATA_DIR=/var/lib/swdc/mysql