scroll-into-view / scroll-into-view-if-needed

Element.scrollIntoView ponyfills for things like "if-needed" and "smooth"

Home Page:https://scroll-into-view.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[TS] typedoc TS1479 error

long76 opened this issue ยท comments

commented
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?

commented

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

commented

@stipsan pr is ready

commented

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 ๐Ÿ“ฆ๐Ÿš€

commented

for webpack users:

  • Add .mjs to the extensions array in your webpack.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.