[TS] typedoc TS1479 error
long76 opened this issue ยท comments
node_modules/antd/es/config-provider/context.d.ts:3:30 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("scroll-into-view-if-needed")' call instead.
3 import type { Options } from 'scroll-into-view-if-needed';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/antd/es/config-provider/index.d.ts:3:30 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("scroll-into-view-if-needed")' call instead.
3 import type { Options } from 'scroll-into-view-if-needed';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/antd/es/form/Form.d.ts:4:30 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("scroll-into-view-if-needed")' call instead.
4 import type { Options } from 'scroll-into-view-if-needed';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/antd/es/form/interface.d.ts:2:47 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("scroll-into-view-if-needed")' call instead.
2 export type { Options as ScrollOptions } from 'scroll-into-view-if-needed';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What version of scroll-into-view-if-needed
are you using?
What version of
scroll-into-view-if-needed
are you using?
https://github.com/ant-design/ant-design/blob/master/package.json#L156
^3.0.3
possible fix
eta-dev/eta#207
eta-dev/eta#213
reproduce steps and codesandbox here ant-design/ant-design#41665
๐ This issue has been resolved in version 3.0.7 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐
for webpack users:
- Add
.mjs
to the extensions array in yourwebpack.config.js
. This ensures that the relevant files can be located at build time. - Add
{ test: /\.mjs$/, include: /node_modules/, type: 'javascript/auto' }
to your rules array in webpack.config.js. This causes Webpack to recognize .mjs files as modules, and changes the way they are handled for imports.