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

something is wrong with the webpack@4.x project #1181

Closed
Wxh16144 opened this issue Apr 9, 2023 · 11 comments
Closed

something is wrong with the webpack@4.x project #1181

Wxh16144 opened this issue Apr 9, 2023 · 11 comments

Comments

@Wxh16144
Copy link

Wxh16144 commented Apr 9, 2023

Hello great developers.

I'm having some problems with my project. As far as I can see it might be caused by the recent update of this repository.

My project is using webpack4 and due to the change of type from module to commonjs in 3.0.8 version I am getting an error in my console. And the build is also affected. I switched to 3.0.7 and I don't have this error anymore.

At first I thought it was a breaking change in compute-scroll-into-view that was causing it. It doesn't look like that.

I would like to know the reason for this adjustment. The ant-design repository is also affected. Although I can fix the problem by locking the version. But I would like to give you feedback and get your suggestions.

my project:
image

ant-design:
image

@Wxh16144
Copy link
Author

Wxh16144 commented Apr 9, 2023

cc @long76

@long76
Copy link
Contributor

long76 commented Apr 9, 2023

cc @long76

Hi, try #1163 (comment)

Please get me reply

@Wxh16144
Copy link
Author

Wxh16144 commented Apr 9, 2023

cc @long76

Hi, try #1163 (comment)

Please get me reply

I noticed that, but I think type="module" should be the correct fix, otherwise it's a BREAKING CHANGE!

@long76
Copy link
Contributor

long76 commented Apr 9, 2023

cc @long76

Hi, try #1163 (comment)
Please get me reply

I noticed that, but I think type="module" should be the correct fix, otherwise it's a BREAKING CHANGE!

it's breaking change only for webpack users which not set config for response .mjs my test app without webpack on TS work correctly. but i agree that the last change broke app on webpack where don't hardcoded version of this library.

for users i see a few variants:

@long76
Copy link
Contributor

long76 commented Apr 9, 2023

@Wxh16144 if you prefer second solution and do not want edit your app just discus this with @stipsan

@long76
Copy link
Contributor

long76 commented Apr 9, 2023

@Wxh16144 and fix for antd is ready ant-design/antd-tools#272

@long76
Copy link
Contributor

long76 commented Apr 9, 2023

check third solution on antd work correctly
before fix in antd-tools

C:\ant-design>npm run dist

> antd@5.4.0 predist
> npm run version


> antd@5.4.0 version
> node ./scripts/generate-version


> antd@5.4.0 dist
> antd-tools run dist

Execute: dist - {}
  - Args: {}

× 🚚  Ant Design Tools
  Compiled with some errors in 2.99m

Webpack Bundle Analyzer saved report to C:\ant-design\report.html
(node:8160) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling processImmediate on process.)
    at emitMakeCallbackDeprecation (node:domain:143:13)
    at process.topLevelDomainCallback (node:domain:157:5)
    at process.callbackTrampoline (node:internal/async_hooks:128:24)

* 🚚  Ant Design Tools █████████████████████████ after chunk asset optimization (93%) SourceMapDevToolPlugin


Error parsing bundle asset "C:\ant-design\dist\antd-with-locales.min.js": no such file
Error parsing bundle asset "C:\ant-design\dist\antd.min.js": no such file

No bundles were parsed. Analyzer will show only original module sizes from stats file.

Webpack Bundle Analyzer saved report to C:\ant-design\report.html
(undefined) ./node_modules/scroll-into-view-if-needed/dist/index.mjs 1:457-458
Can't import the named export 'compute' from non EcmaScript module (only default export is available)
    at HarmonyImportSpecifierDependency._getErrors (C:\ant-design\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:88:6)
    at HarmonyImportSpecifierDependency.getErrors (C:\ant-design\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:68:16)
    at Compilation.reportDependencyErrorsAndWarnings (C:\ant-design\node_modules\webpack\lib\Compilation.js:1463:22)
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1258:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:31:1)
    at AsyncSeriesHook.lazyCompileHook (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at Compilation.finish (C:\ant-design\node_modules\webpack\lib\Compilation.js:1253:28)
    at C:\ant-design\node_modules\webpack\lib\Compiler.js:672:17
    at _done (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)
    at eval (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:32:22)
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1185:12
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1097:9
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
 @ ./components/anchor/Anchor.tsx
 @ ./components/anchor/index.ts
 @ ./components/index.ts
 @ ./index-with-locales.js
(undefined) ./node_modules/scroll-into-view-if-needed/dist/index.mjs 1:547-548
Can't import the named export 'compute' from non EcmaScript module (only default export is available)
    at HarmonyImportSpecifierDependency._getErrors (C:\ant-design\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:88:6)
    at HarmonyImportSpecifierDependency.getErrors (C:\ant-design\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:68:16)
    at Compilation.reportDependencyErrorsAndWarnings (C:\ant-design\node_modules\webpack\lib\Compilation.js:1463:22)
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1258:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:31:1)
    at AsyncSeriesHook.lazyCompileHook (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at Compilation.finish (C:\ant-design\node_modules\webpack\lib\Compilation.js:1253:28)
    at C:\ant-design\node_modules\webpack\lib\Compiler.js:672:17
    at _done (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)
    at eval (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:32:22)
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1185:12
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1097:9
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
 @ ./components/anchor/Anchor.tsx
 @ ./components/anchor/index.ts
 @ ./components/index.ts
 @ ./index-with-locales.js
(undefined) ./node_modules/scroll-into-view-if-needed/dist/index.mjs 1:457-458
Can't import the named export 'compute' from non EcmaScript module (only default export is available)
    at HarmonyImportSpecifierDependency._getErrors (C:\ant-design\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:88:6)
    at HarmonyImportSpecifierDependency.getErrors (C:\ant-design\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:68:16)
    at Compilation.reportDependencyErrorsAndWarnings (C:\ant-design\node_modules\webpack\lib\Compilation.js:1463:22)
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1258:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:20:1)
    at AsyncSeriesHook.lazyCompileHook (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at Compilation.finish (C:\ant-design\node_modules\webpack\lib\Compilation.js:1253:28)
    at C:\ant-design\node_modules\webpack\lib\Compiler.js:672:17
    at _done (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)
    at eval (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:32:22)
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1185:12
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1097:9
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
 @ ./components/anchor/Anchor.tsx
 @ ./components/anchor/index.ts
 @ ./components/index.ts
 @ ./index-with-locales.js
(undefined) ./node_modules/scroll-into-view-if-needed/dist/index.mjs 1:547-548
Can't import the named export 'compute' from non EcmaScript module (only default export is available)
    at HarmonyImportSpecifierDependency._getErrors (C:\ant-design\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:88:6)
    at HarmonyImportSpecifierDependency.getErrors (C:\ant-design\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:68:16)
    at Compilation.reportDependencyErrorsAndWarnings (C:\ant-design\node_modules\webpack\lib\Compilation.js:1463:22)
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1258:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:20:1)
    at AsyncSeriesHook.lazyCompileHook (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at Compilation.finish (C:\ant-design\node_modules\webpack\lib\Compilation.js:1253:28)
    at C:\ant-design\node_modules\webpack\lib\Compiler.js:672:17
    at _done (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)
    at eval (eval at create (C:\ant-design\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:32:22)
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1185:12
    at C:\ant-design\node_modules\webpack\lib\Compilation.js:1097:9
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
 @ ./components/anchor/Anchor.tsx
 @ ./components/anchor/index.ts
 @ ./components/index.ts
 @ ./index-with-locales.js

after fix

C:\ant-design>npm run dist

> antd@5.4.0 predist
> npm run version


> antd@5.4.0 version
> node ./scripts/generate-version


> antd@5.4.0 dist
> antd-tools run dist

Execute: dist - {}
  - Args: {}

√ 🚚  Ant Design Tools
  Compiled successfully in 2.93m

Webpack Bundle Analyzer saved report to C:\ant-design\report.html
(node:9492) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling processImmediate on process.)
    at emitMakeCallbackDeprecation (node:domain:143:13)
    at process.topLevelDomainCallback (node:domain:157:5)
    at process.callbackTrampoline (node:internal/async_hooks:128:24)

√ 🚚  Ant Design Tools


Webpack Bundle Analyzer saved report to C:\ant-design\report.html
Child
    Time: 287847ms
    Built at: 09.04.2023 13:55:46
                           Asset      Size  Chunks                          Chunk Names
        antd-with-locales.min.js  1.53 MiB       0  [emitted]        [big]  antd-with-locales.min
    antd-with-locales.min.js.map  5.91 MiB       0  [emitted] [dev]         antd-with-locales.min
                     antd.min.js  1.27 MiB       1  [emitted]        [big]  antd.min
                 antd.min.js.map  5.35 MiB       1  [emitted] [dev]         antd.min
    Entrypoint antd.min [big] = antd.min.js antd.min.js.map
    Entrypoint antd-with-locales.min [big] = antd-with-locales.min.js antd-with-locales.min.js.map
Child
    Time: 176006ms
    Built at: 09.04.2023 13:53:56
                       Asset      Size             Chunks                          Chunk Names
        antd-with-locales.js  8.36 MiB  antd-with-locales  [emitted]        [big]  antd-with-locales
    antd-with-locales.js.map  7.58 MiB  antd-with-locales  [emitted] [dev]         antd-with-locales
                     antd.js  7.76 MiB               antd  [emitted]        [big]  antd
                 antd.js.map  6.94 MiB               antd  [emitted] [dev]         antd
    Entrypoint antd [big] = antd.js antd.js.map
    Entrypoint antd-with-locales [big] = antd-with-locales.js antd-with-locales.js.map
[Dist] Finalization...

@long76
Copy link
Contributor

long76 commented Apr 9, 2023

try find another solution

@long76
Copy link
Contributor

long76 commented Apr 9, 2023

@Wxh16144 @stipsan it's my mistake sorry for that, PR is ready:
compute-scroll-into-view scroll-into-view/compute-scroll-into-view#891
scroll-into-view-if-needed #1183

@long76
Copy link
Contributor

long76 commented Apr 10, 2023

@Wxh16144 fix released, version 3.0.9

@Wxh16144
Copy link
Author

Respect~

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

Successfully merging a pull request may close this issue.

2 participants