Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Bug: The requested module '/node_modules/.vite/deps/medusa-react.js' does not provide an export named 'useAdminAddLocationToSalesChannel' #924

Open
matbrgz opened this issue Apr 6, 2023 · 5 comments

Comments

@matbrgz
Copy link

matbrgz commented Apr 6, 2023

Hello,

I'm running an application in a Docker container based on the repository https://github.com/medusajs/docker-medusa. After installing the admin module from https://github.com/medusajs/admin, I'm getting the following error:

image

Unexpected Application Error!
The requested module '/node_modules/.vite/deps/medusa-react.js?v=c2e74af3' does not provide an export named 'useAdminAddLocationToSalesChannel'
SyntaxError: The requested module '/node_modules/.vite/deps/medusa-react.js?v=c2e74af3' does not provide an export named 'useAdminAddLocationToSalesChannel'
💿 Hey developer 👋
You can provide a way better UX than this when your app throws errors by providing your own ErrorBoundary prop on <Route>

I've tried cloning the admin repository and using
Dockerfile

FROM node:18.15.0
EXPOSE 7000
WORKDIR /app/admin
COPY package*.json ./
RUN rm -rf node_modules
RUN apt-get update
RUN npm install -g npm@latest
COPY . .
RUN npm install --force
RUN npm run build &> /dev/null
COPY develop.sh .
ENTRYPOINT ["./develop.sh", "develop"]

develop.sh

#!/bin/bash

medusa user -e [email protected] -p some-password

npm run $1

Docker Logs

2023-04-06 11:10:11 
2023-04-06 11:10:11 > [email protected] develop
2023-04-06 11:10:11 > npm run dev
2023-04-06 11:10:11 
2023-04-06 11:10:11 
2023-04-06 11:10:11 > [email protected] dev
2023-04-06 11:10:11 > vite --port 7000 --host
2023-04-06 11:10:11 
2023-04-06 11:10:12 
2023-04-06 11:10:12   VITE v4.2.1  ready in 470 ms
2023-04-06 11:10:12 
2023-04-06 11:10:12   ➜  Local:   http://localhost:7000/
2023-04-06 11:10:12   ➜  Network: http://172.20.0.6:7000/
2023-04-06 11:10:10 ./develop.sh: line 3: medusa: command not found
2023-04-06 11:10:17 2:10:17 PM [vite] error while updating dependencies:
2023-04-06 11:10:17 Error: ENOENT: no such file or directory, rename '/app/admin/node_modules/.vite/deps_temp_943c5659' -> '/app/admin/node_modules/.vite/deps'
2023-04-06 11:10:17     at renameSync (node:fs:1040:3)
2023-04-06 11:10:17     at Object.commit (file:///app/admin/node_modules/vite/dist/node/chunks/dep-79892de8.js:44685:19)
2023-04-06 11:10:17     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-04-06 11:10:17     at async commitProcessing (file:///app/admin/node_modules/vite/dist/node/chunks/dep-79892de8.js:44144:17)
2023-04-06 11:10:17     at async runOptimizer (file:///app/admin/node_modules/vite/dist/node/chunks/dep-79892de8.js:44182:17)

Version:

medusa-starter-default: 0.0.1
Medusa Admin: 0.1.0
Medusa-React: ^4.0.4
Node: LTS 18.15.0
NPM: Latest

I believe there may be a bug with the admin module, and I wanted to report it so it can be fixed. Additionally, I received a suggestion to provide a custom ErrorBoundary prop on to improve the UX when the app throws errors.

Thank you for your attention to this issue.

@olivermrbl
Copy link
Contributor

olivermrbl commented Apr 6, 2023

This project is in maintenance mode and only very critical fixes are attended to. I recommend switching to our new admin system. It should resolve your issues.

@SkyLuoPing
Copy link

I also encountered the same issue after installing useAdminAddLocationToSalesChannel
Removing the package. json version number and reinstalling it still has the same issue

I would like to replace the Postgres database with MySQL in medusa.comfig.js if configured

@SkyLuoPing
Copy link

SkyLuoPing commented Apr 7, 2023

npm install @medusajs/admin

Still unable to access prompt

Unexpected Application Error!
The requested module '/node_modules/.vite/deps/medusa-react.js?v=6c51e4c8' does not provide an export named 'useAdminAddLocationToSalesChannel'
SyntaxError: The requested module '/node_modules/.vite/deps/medusa-react.js?v=6c51e4c8' does not provide an export named 'useAdminAddLocationToSalesChannel'
💿 Hey developer 👋

You can provide a way better UX than this when your app throws errors by providing your own errorElement props on

@ohmygod481999
Copy link

In package.json, change version of "medusa-react" to 5.0.0 and install again should solve your problem

@SkyLuoPing
Copy link

ohmygod481999:
thank you! Dependency package installation solves the problem!!!

How to install the new version of medusa admin UI

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants