saleor-dashboard icon indicating copy to clipboard operation
saleor-dashboard copied to clipboard

can't access "http://localhost:9000/" and "http://localhost:3000/"

Open ailijian opened this issue 1 year ago • 6 comments

Description of the issue

Help, I strictly follow the salesor and saleor-dashboard documents to complete the installation, "npm run dev" does not report an error, but I can't access "http://localhost:9000/", please let me know, thank you very much. image image

In addition, the screenshot of "python manage.py runserver" is as follows. I don't think there is a serious error, but please help me analyze whether there is an error in the installation of saleor. image

I was installing "react-storefront", and there was an error, please help me to solve it, thank you, the error is as follows: image

My "http://127.0.0.1:8000/graphql/" can be accessed normally image

Steps to reproduce the problem

Installing Saleor Clone the repository:

git clone https://github.com/saleor/saleor.git cd saleor

Install the dependencies into a new Python virtual environment:

Command Prompt

python -m venv saleor-venv saleor-venv\Scripts\activate.bat python -m pip install -r requirements.txt

Create a database user using the command line tools that came with your PostgreSQL installation:

C:"Program Files"\PostgreSQL\15\bin\createuser.exe --username=postgres --superuser --pwprompt saleor

Please correct the path if your installation path or PostgreSQL version are different.

When asked to choose a password for the new role, use "saleor" (or see how to configure Saleor to use a different password). When asked for your password, give the one you set during the installation of PostgreSQL.

CAUTION If you've decided to substitute your own credentials, make sure you create a "superuser". Otherwise, the user won't be able to install all the necessary database extensions.

Create a database:

C:"Program Files"\PostgreSQL\15\bin\createdb.exe --username=postgres --owner=saleor saleor

Migrate the database:

python manage.py migrate

CAUTION This command creates database extensions. If you get an error related to the CREATE EXTENSION command, please return to the user creation step above.

Create a super user account for dashboard

python manage.py createsuperuser

Starting the API server Remember to activate your Python virtual environment if needed (you will need to do this every time you open a new terminal window):

Command Prompt PowerShell cd saleor saleor-venv\Scripts\activate.bat

Then execute:

python manage.py runserver

Development Clone the repository: git clone https://github.com/saleor/saleor-dashboard.git Enter the project directory: cd saleor-dashboard Install the dependencies: npm i Configure the env vars as described in docs/configuration.md.

Start the development server with:

npm run dev

What did you expect to happen?

I want to visit "http://localhost:9000/" normally

Additional information

No response

Environment

my version windows 11 python 3.9.16 saleor-core 3.13.18 saleor-dashboard 3.13.4

ailijian avatar Jun 12 '23 09:06 ailijian

If u check console, it will be this: image Hope it will helps to speedup bugfix

uy5cu71 avatar Oct 08 '23 17:10 uy5cu71

Any update on this? i have same issue on my local

naseef0 avatar Oct 12 '23 06:10 naseef0

Hey, sorry keeping you that long. Based on your posts seems like it's sort of wrong vite configuration that doesn't work properly on windows. In one of your screenshots the vite is not able to load index.tsx. We need to investigate it internally

andrzejewsky avatar Oct 26 '23 10:10 andrzejewsky

Not a JS developer, but the issue seems to be coming from the use of a path resolver along with vite-plugin-html.

Some things to consider as a potential cause:

  1. Either path.resolve is not compatible with Windows paths.
  2. Or your browser blocks the access to local files (which is mostly a normal behaviour), because of the use of directory letters in windows e.g. "C:/" or it maybe any other security reason.

Temporary solution:

Since "src" folder is exposed as a root, you can replace the entry value of createHtmlPlugin from entry: path.resolve(__dirname, "src", "index.tsx"), to entry: "index.tsx",. P.S: I haven't tested it on other platforms, so you might have to roll back before prod.

Not sure why one of them is set using absolute path and the template as just a filename. I might be wrong but I think it's better to put index.html outside of src and in general sticking with relative paths I believe is a good practice.

aidensgithub avatar Nov 15 '23 14:11 aidensgithub

Not a JS developer, but the issue seems to be coming from the use of a path resolver along with vite-plugin-html.

Some things to consider as a potential cause:

  1. Either path.resolve is not compatible with Windows paths.
  2. Or your browser blocks the access to local files (which is mostly a normal behaviour), because of the use of directory letters in windows e.g. "C:/" or it maybe any other security reason.

Temporary solution:

Since "src" folder is exposed as a root, you can replace the entry value of createHtmlPlugin from entry: path.resolve(__dirname, "src", "index.tsx"), to entry: "index.tsx",. P.S: I haven't tested it on other platforms, so you might have to roll back before prod.

Not sure why one of them is set using absolute path and the template as just a filename. I might be wrong but I think it's better to put index.html outside of src and in general sticking with relative paths I believe is a good practice.

I'm using Ubuntu i have the same issue but only in edge browser. check this out https://github.com/saleor/saleor-dashboard/issues/4393

naseef0 avatar Nov 15 '23 15:11 naseef0

it worked in my case

parmanand007 avatar Dec 09 '23 06:12 parmanand007