Skip to content
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

[TS] typedoc TS1479 error #1163

Closed
long76 opened this issue Mar 1, 2023 · 8 comments
Closed

[TS] typedoc TS1479 error #1163

long76 opened this issue Mar 1, 2023 · 8 comments
Labels

Comments

@long76
Copy link
Contributor

long76 commented Mar 1, 2023

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';
                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@stipsan
Copy link
Member

stipsan commented Mar 20, 2023

What version of scroll-into-view-if-needed are you using?

@long76
Copy link
Contributor Author

long76 commented Mar 21, 2023

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

@long76
Copy link
Contributor Author

long76 commented Apr 6, 2023

possible fix
eta-dev/eta#207
eta-dev/eta#213

@long76 long76 changed the title typedoc error [TS] typedoc TS1479 error Apr 6, 2023
long76 added a commit to long76/scroll-into-view-if-needed that referenced this issue Apr 6, 2023
@long76
Copy link
Contributor Author

long76 commented Apr 6, 2023

@stipsan pr is ready

@long76
Copy link
Contributor Author

long76 commented Apr 6, 2023

reproduce steps and codesandbox here ant-design/ant-design#41665

@long76
Copy link
Contributor Author

long76 commented Apr 6, 2023

@stipsan stipsan closed this as completed in d9053bb Apr 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

🎉 This issue has been resolved in version 3.0.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@long76
Copy link
Contributor Author

long76 commented Apr 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants