forked from medusajs/medusa
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add a troubleshooting guide for dist imports (medusajs#9442)
- Loading branch information
1 parent
ab5a7ca
commit 1bb3f8b
Showing
6 changed files
with
55 additions
and
30 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
www/apps/resources/app/troubleshooting/dist-imports/page.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
export const metadata = { | ||
title: `Importing from /dist Sub-Path`, | ||
} | ||
|
||
# {metadata.title} | ||
|
||
Because of how Medusa packages are bundled and released, importing from the `/dist` sub-path of its packages is not allowed. | ||
|
||
For example, this is not allowed: | ||
|
||
```ts | ||
import { | ||
AdminGetApiKeysParams | ||
} from "@medusajs/medusa/dist/api/admin/api-keys" // <-- Not allowed | ||
``` | ||
## Importing from Exposed Directories | ||
The `@medusajs/medusa` package allows you to import from the following sub-directories: | ||
- `api` | ||
- `subscribers` | ||
- `jobs` | ||
- `core-flows` | ||
- `loaders` | ||
- `commands` | ||
So, you can still import `AdminGetApiKeysParams` from the example above, however, the import path shouldn't include `/dist`. | ||
So, this is allowed: | ||
```ts | ||
import { | ||
AdminGetApiKeysParams | ||
} from "@medusajs/medusa/api/admin/api-keys" // <-- Allowed | ||
``` |
11 changes: 0 additions & 11 deletions
11
www/apps/resources/app/troubleshooting/pnpm-errors/page.mdx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters