diff --git a/docs/_fragments/_decorator-info.mdx b/docs/_fragments/_decorator-info.mdx index 7f47d8c4..238c40d3 100644 --- a/docs/_fragments/_decorator-info.mdx +++ b/docs/_fragments/_decorator-info.mdx @@ -13,4 +13,6 @@ Using legacy decorators requires to use a transpiler such as [TypeScript](https: [Babel](https://babeljs.io/docs/babel-plugin-proposal-decorators) or others to compile them to JavaScript. Alternatively, Sequelize also supports [a legacy approach](../other-topics/legacy-model-definitions.mdx) that does not require using decorators, but this is discouraged. +If you're using TypeScript, you will also need to configure it to be able to resolve this export, [see our Getting Started guide](../getting-started.mdx#typescript) for more information. + ::: diff --git a/docs/getting-started.mdx b/docs/getting-started.mdx index a34c7505..1493379b 100644 --- a/docs/getting-started.mdx +++ b/docs/getting-started.mdx @@ -99,6 +99,18 @@ Head to the [Version Policy page](/releases) to know which versions of TypeScrip and make sure that the [`@types/node`](https://www.npmjs.com/package/@types/node) package corresponding to your Node.js version is installed in your project. +:::info + +Sequelize makes use of the the [`exports`](https://nodejs.org/api/packages.html#exports) `package.json` field. +You may need to update your `tsconfig.json` configuration to make sure TypeScript's module resolution supports it. + +At time of writing (TS 5.4), this can be done in two ways: + +- Set [`moduleResolution`](https://www.typescriptlang.org/tsconfig#moduleResolution) to `node16`, `nodenext`, or `bundler`, +- or set [`resolvePackageJsonExports`](https://www.typescriptlang.org/tsconfig#resolvePackageJsonExports) to `true`. + +::: + ## CommonJS or ESM? Our documentation makes heavy use of ECMAScript Modules (ESM), but CommonJS is fully supported by Sequelize.