lanmch

lanmch

Member Since 4 years ago

Experience Points
4
follower
Lessons Completed
0
follow
Best Reply Awards
22
repos

33 contributions in the last year

Pinned
⚡ 人脸情绪实时检测、关键点检测、表情可视化分析
⚡ urlove-wxapp
⚡ first react project
⚡ 客户端and管理端
Activity
May
17
1 day ago
Activity icon
issue

lanmch issue comment webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

lanmch
lanmch

not sure that it is possible to solve this.. we can't track loading state for script tag..

for another, could you please tell me why the default timeout time is 120 seconds rather than other value?

Activity icon
issue

lanmch issue comment webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

lanmch
lanmch

not sure that it is possible to solve this.. we can't track loading state for script tag..

yes, I also can not find a very good way to solve this problem till now. In my project, I just set the timeout value from 120000 to 10000 when the needAttach is false.

May
16
2 days ago
Activity icon
issue

lanmch issue comment webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

lanmch
lanmch

like this in your dist/index.html

<script src="{your project path}/webpack-dynamic-demo/dist/src_dynamic-module_js.bundle.js"></script>

when the website run with index.html, the webpack_require__.l will try to append the dynamic import script to html. image But at first, it will judge if the html has the script same tag, and set the 'needAttach' value. eg. in the demo, when the index.html run, it will try to append the script with the src of 'src_dynamic-module_js.bundle.js', but at first in the judge function, it already exists, so it will not append to html. image image

Then, in the code behind, it will define a timeout about this js resource, but not append it to html dom

So when we have an error with network of 'src_dynamic-module_js.bundle.js', the script of it will load with error in Chrome. And as the code executes to load the dynamic import js, it judge and define timeout but not append script. The final phenomenon is the onerror with the onScriptComplete will throw after the timeout code is executed(120000ms)

Activity icon
issue

lanmch issue comment webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

lanmch
lanmch

I don't understand then.. in your example I have error because of

<script src="file:///Users/bytedance/Desktop/demo-project/webpack-dynamic-demo/dist/src_dynamic-module_js.bundle.js"></script>

that doesn't exists on my disk... You getting timeout error because of your network.. ( thats why it is fired after 120s ) With "normal" chunk loading error it will be fired immediately.

sorry, you can change the script in webpack-dynamic-error-demo/index.html to simulate it

<script src="{your project path}/webpack-dynamic-demo/dist/src_dynamic-module_js.bundle.js"></script>

In our project, we use a plugin like preload-webpack-plugin for webpack5, to make the main purpose here is to make some scripts on the main link as early as possible to avoid the insertion of some asynchronous tasks. Because to show the minimal reproducible demo, I dont show you the plugin. So I try to use the hard code to let you know the final build result in my project

In final result, the script maybe like

<script src="https://www.cdnpath.com/js/src_dynamic-module_js.bundle.js" ></script>

So, there is no file path about 'file://' in the code actually

Activity icon
issue

lanmch issue comment webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

lanmch
lanmch

I don't understand then.. in your example I have error because of

<script src="file:///Users/bytedance/Desktop/demo-project/webpack-dynamic-demo/dist/src_dynamic-module_js.bundle.js"></script>

that doesn't exists on my disk...

You getting timeout error because of your network.. ( thats why it is fired after 120s ) With "normal" chunk loading error it will be fired immediately.

sorry, you can change the script in webpack-dynamic-error-demo/index.html to simulate it

<script src="{your project path}/webpack-dynamic-demo/dist/src_dynamic-module_js.bundle.js"></script>

In our project, we use a plugin like preload-webpack-plugin for webpack5, to make the main purpose here is to make some scripts on the main link as early as possible to avoid the insertion of some asynchronous tasks. Because to show the minimal reproducible demo, I dont show you the plugin. So I try to use the hard code to let you know the final build result in my project

Activity icon
issue

lanmch issue comment webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

May
13
5 days ago
Activity icon
issue

lanmch issue comment webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

lanmch
lanmch

the dist is generate by webpack, how can I remove it? It one of the dynamic import bundle js file

Activity icon
issue

lanmch issue comment webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

lanmch
lanmch
Activity icon
issue

lanmch issue comment webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

lanmch
lanmch

I think there should have to judge the dynamic import script is be load before in html or not

Activity icon
issue

lanmch issue comment webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

lanmch
lanmch

because in webpack_require.l, the same src with dynamic import not generate(so the onerror can bind the function onCompletet), but it trigger the timeout.

Activity icon
issue

lanmch issue webpack/webpack

lanmch
lanmch

when request with error(like 404), the script(which created by dynamic import) fires a timeout instead of the onerror

Bug report

What is the current behavior? About the dynamic import, when the script's(like some js resource in CDN) get an error(like 404 or abort), the webpack made it trigger the timeout logic instead of the onerror logic. So, it will throw an error after 120 seconds rather than right now.

eg. when I block the url, the error throw after 120s. image image

If the current behavior is a bug, please provide the steps to reproduce. you can clone the demo project form here: https://github.com/lanmch/webpack-dynamic-error-demo run the script

npm install
npm run build
then open the dist/index.html in browser

may there are some speciel code in our project. Like the dynamic module's name is src_dynamic-module_js, so that the file js name is src_dynamic-module_js.bundle.js. To make my js resource preloaded, I insert the src_dynamic-module_js with script into the final html by HtmlWebpackPlugin. So that I find the code of webpack_require.l's definition may have some error about this case.

What is the expected behavior? I think the error maybe throw right now when it have problem with network, or in few minutes rather than 120s.

Other relevant information: webpack version: 5.72.1 Node.js version: 14.16.0 Operating System: macOS

Activity icon
created branch
createdAt 5 days ago
Apr
29
2 weeks ago
Activity icon
issue

lanmch issue comment lanmch/webpack-

lanmch
lanmch

build(deps): bump async from 2.6.3 to 2.6.4

Bumps async from 2.6.3 to 2.6.4.

Changelog

Sourced from async's changelog.

v2.6.4

  • Fix potential prototype pollution exploit (#1828)
Commits
Maintainer changes

This version was pushed to npm by hargasinski, a new releaser for async since your current version.


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

lanmch
lanmch

您好,我已收到您的邮件,我会尽快给您回复。

Mar
28
1 month ago
Activity icon
issue

lanmch issue comment pnpm/pnpm

lanmch
lanmch

set the overrides but it looks like not work

pnpm version:

6.17.0

Code to reproduce the issue:

Recently, out project change from yarn to pnpm because of its speed. But when I install the modules, I find it not like what we expected.(Maybe I think the overrides property is like yarn resolution) Here is the package.json code

{
    "dependencies": {
        "@editor-kit/core": "3.37.0-rc.0"
    }
    "pnpm": {
        "overrides": {
                "@editor-kit/core": "3.37.0-rc.0"
        }
    }
}

Here is the node_modules Topology in .pnpm folder after pnpm install image

Also in pnpm-lock.yaml file, I find the same version package(@editor-kit/core) with different hash.

Expected behavior:

Just one package will be install when I set the overrides

Actual behavior:

Many package, and these package have same version with different hash. Really expecting a reply!

Additional information:

Old and large project, there is too much dependencies

  • node -v prints: 14.16.0
  • Windows, macOS, or Linux?: macOS
lanmch
lanmch

您好,我已收到您的邮件,我会尽快给您回复。

Mar
17
2 months ago
Activity icon
issue

lanmch issue comment pnpm/pnpm

lanmch
lanmch

pnpm link modified the dependencies of non-link packages

pnpm version:

6.23.6

Code to reproduce the issue:

Aboutpnpm link when I use the pnpm link

to link my package to debug, I find the package's (witch is not the link package) dependencies has been changed. So that my project cannot run successful. the other packages some dependencies like the path showed by vscode before link: image after link: 3MgZQiLkk7

Expected behavior:

pnpm should not change other pkg's dependencies path

Actual behavior:

pnpm changes other pkg's dependencies path

Additional information:

last week, we change our npm manager from yarn to pnpm. The link can do well as yarn but not ok about pnpm.

  • node -v prints: 14.16
  • Windows, macOS, or Linux?: macOS
lanmch
lanmch

is there any one who can help me?

Mar
14
2 months ago
Activity icon
issue

lanmch issue pnpm/pnpm

lanmch
lanmch

pnpm link modified the dependencies of non-link packages

pnpm version:

6.23.6

Code to reproduce the issue:

Aboutpnpm link when I use the pnpm link

to link my package to debug, I find the package's (witch is not the link package) dependencies has been changed. So that my project cannot run successful. the other packages some dependencies like the path showed by vscode before link: image after link: 3MgZQiLkk7

Expected behavior:

pnpm should not change other pkg's dependencies path

Actual behavior:

pnpm changes other pkg's dependencies path

Additional information:

last week, we change our npm manager from yarn to pnpm. The link can do well as yarn but not ok about pnpm.

  • node -v prints: 14.16
  • Windows, macOS, or Linux?: macOS
Mar
10
2 months ago
Activity icon
issue

lanmch issue comment pnpm/pnpm

lanmch
lanmch

set the overrides but it looks like not work

pnpm version:

6.17.0

Code to reproduce the issue:

Recently, out project change from yarn to pnpm because of its speed. But when I install the modules, I find it not like what we expected.(Maybe I think the overrides property is like yarn resolution) Here is the package.json code

{
    "dependencies": {
        "@editor-kit/core": "3.37.0-rc.0"
    }
    "pnpm": {
        "overrides": {
                "@editor-kit/core": "3.37.0-rc.0"
        }
    }
}

Here is the node_modules Topology in .pnpm folder after pnpm install image

Also in pnpm-lock.yaml file, I find the same version package(@editor-kit/core) with different hash.

Expected behavior:

Just one package will be install when I set the overrides

Actual behavior:

Many package, and these package have same version with different hash. Really expecting a reply!

Additional information:

Old and large project, there is too much dependencies

  • node -v prints: 14.16.0
  • Windows, macOS, or Linux?: macOS
lanmch
lanmch

same problems in pnpm workspace,version 6.15.1

你在packageExtension里面设置一下,把peerdependencies设置成*,就可以避免这个问题了。可以在lark上交流

Feb
24
2 months ago
Activity icon
issue

lanmch issue pnpm/pnpm

lanmch
lanmch

the output dist volume(size) from webpack, it is larger by pnpm than by yarn

What we have do

Recently, we change our project's npm manager from yarn v1 to pnpm. Of course the install speed is so quickly. But we met a question of the output dist's size (by webpack packing). Anytime when we build the project and publish it, we will analyze the bundle size(include assets/chunks/modules) through the webpack stats json. The output dist size is larger when we install by pnpm than we install by yarn in the past.(Average increase of 1% per asset). At the beginning, I think the pnpm's path will affect the size, because the npm module(by pnpm) path is like './node_modules/.pnpm/chart/node_modules/chart/index', but the yarn path just is './node_modules/chart/index'. The pnpm is longer than yarn, so through the gradual accumulation of negative effects, the total volume has become larger. But I find that, the webpack config of chunkIds and moduleIds is determistic (just is a number and has no effect on the filepath). So,I don't know where the mentioned growth comes from.

I have set the packageExtension, so I am sure every npm module just the unique, they don't hav the the same version package with different version.(because of the peerdependencies)

pnpm version:

6.23.6

Expected behavior:

Be same with the yarn, or do you have met the same question? If yes, I hope you can tell me how to solve it or why have this phenomenon

Actual behavior:

like the below question

Additional information:

  • node -v prints: 14.16.0
  • Windows, macOS, or Linux?: macOS
Activity icon
issue

lanmch issue danvk/source-map-explorer

lanmch
lanmch

What is the no source mean?

recently, we change our npm manager, but i found that the no source increase too much, maybe every chunk +100~200KB, but I dont know how to find the real code which should not be added. hope for help