-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vite error: Failed to resolve entry for package "@mercurjs/http-client" #37
Comments
Thanks for feedback. I have just added information about codegen in the README.
yarn codegen
yarn dev Currently we are developing vendor dashboard so you can skip these commands, go to the backend folder and run medusa in dev mode cd apps/backend
yarn dev |
Running the codegen command didn't solve the problem and instead deleted all the vendor types in mercure/packages/http-client/codegen/types. |
For me running 'yarn codegen' caused files in '/packages/http-client/codegen' to be changed i.e
|
For me as well |
We have migrated from using orval to using swagger-typescript-api due to generated type errors. The only thing you need to do is build the http-client package using the yarn build command, as type generation has already been addressed. |
Hello, I don't hunderstand how start vendor panel i have
The packages is not link correctely ? |
After following the quickstart and correctly creating the db, running migration and seeding, after running 'yarn dev' from the main and navigating to 'localhost:7001' i get a Vite error, regarding the http-client package not resolving correctly. Also, if i check VS Code intellisense, it also shows a red underlining, not knowing where to grab it. Note that the server is started correctly and i can navigate to Admin panel, but not the Vendor one.
Complete log:
`E:\training\medusa\mercur>yarn dev
yarn run v1.22.21
$ turbo run dev
turbo 2.3.3
• Packages in scope: @mercurjs/http-client, medusa-starter-default, vendor
• Running dev in 3 packages
• Remote caching disabled
medusa-starter-default:dev: cache bypass, force executing e146ac122b6cc0f8
vendor:dev: cache bypass, force executing 52b904a92095cc28
vendor:dev: yarn run v1.22.21
medusa-starter-default:dev: yarn run v1.22.21
medusa-starter-default:dev: $ medusa develop --types=false
vendor:dev: $ vite --port 7001
vendor:dev:
vendor:dev: VITE v6.0.2 ready in 254 ms
vendor:dev:
vendor:dev: ➜ Local: http://localhost:7001/
vendor:dev: ➜ Network: use --host to expose
medusa-starter-default:dev: info: Watching filesystem to reload dev server on file change
medusa-starter-default:dev: info: Skipping instrumentation registration. No register function found.
medusa-starter-default:dev: redisUrl not found. A fake redis instance will be used.
medusa-starter-default:dev: warn: Local Event Bus installed. This is not recommended for production.
medusa-starter-default:dev: info: Locking module: Using "in-memory" as default.
medusa-starter-default:dev: info: No job to load from E:\training\medusa\mercur\node_modules@medusajs\medusa\dist\jobs. skipped.
medusa-starter-default:dev: - Creating server
medusa-starter-default:dev: ✔ Server is ready on http://localhost:9000 – 2ms
medusa-starter-default:dev: info: Admin URL → http://localhost:9000/app
vendor:dev: 11:15:26 AM [vite] Internal server error: Failed to resolve entry for package "@mercurjs/http-client". The package may have incorrect main/module/exports specified in its package.json.
vendor:dev: Plugin: vite:import-analysis
vendor:dev: File: E:/training/medusa/mercur/apps/vendor/src/entities/seller/model.ts:2:54
vendor:dev: 1 | import { queryKeysFactory } from "@/shared/lib";
vendor:dev: 2 | import { vendorCreateSeller, vendorGetSellerMe } from "@mercurjs/http-client";
vendor:dev: | ^
vendor:dev: 3 | import {
vendor:dev: 4 | useMutation,
vendor:dev: at packageEntryFailure (file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:16287:15)
vendor:dev: at resolvePackageEntry (file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:16284:3)
vendor:dev: at tryNodeResolve (file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:16149:18)
vendor:dev: at ResolveIdContext.resolveId (file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:15934:19)
vendor:dev: at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
vendor:dev: at async EnvironmentPluginContainer.resolveId (file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:46929:22)
vendor:dev: at async TransformPluginContext.resolve (file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:47089:15)
vendor:dev: at async normalizeUrl (file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:45419:26)
vendor:dev: at async file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:45550:39
vendor:dev: at async Promise.all (index 1)
vendor:dev: at async TransformPluginContext.transform (file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:45477:7)
vendor:dev: at async EnvironmentPluginContainer.transform (file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:47009:18)
vendor:dev: at async loadAndTransform (file:///E:/training/medusa/mercur/apps/vendor/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:40848:27)
vendor:dev: 11:15:26 AM [vite] (client) Pre-transform error: Failed to resolve entry for package "@mercurjs/http-client". The package may have incorrect main/module/exports specified in its package.json.
vendor:dev: Plugin: vite:import-analysis
vendor:dev: File: E:/training/medusa/mercur/apps/vendor/src/entities/seller/model.ts:2:54
vendor:dev: 1 | import { queryKeysFactory } from "@/shared/lib";
vendor:dev: 2 | import { vendorCreateSeller, vendorGetSellerMe } from "@mercurjs/http-client";
vendor:dev: | ^
vendor:dev: 3 | import {
vendor:dev: 4 | useMutation,`
The text was updated successfully, but these errors were encountered: