saleor-dashboard
saleor-dashboard copied to clipboard
can't access "http://localhost:9000/" and "http://localhost:3000/"
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.
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.
I was installing "react-storefront", and there was an error, please help me to solve it, thank you, the error is as follows:
My "http://127.0.0.1:8000/graphql/" can be accessed normally
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
If u check console, it will be this:
Hope it will helps to speedup bugfix
Any update on this? i have same issue on my local
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
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:
- Either path.resolve is not compatible with Windows paths.
- 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.
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:
- Either path.resolve is not compatible with Windows paths.
- 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"),
toentry: "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
it worked in my case