Open Bisstocuz opened 11 months ago
Thanks for posting, the timeout is not currently configurable but can be configured through the fetch options for make-fetch-happen
. This is called in https://github.com/jspm/generator/blob/main/src/common/fetch-node.ts and the timeout docs can be found at https://github.com/npm/make-fetch-happen#--optsretry.
It should be straightforward to wire through an option, or simply extend the default - would you be able to try making a PR for that? If not I can make the update this week as well.
Thanks for posting, the timeout is not currently configurable but can be configured through the fetch options for
make-fetch-happen
. This is called in https://github.com/jspm/generator/blob/main/src/common/fetch-node.ts and the timeout docs can be found at https://github.com/npm/make-fetch-happen#--optsretry.It should be straightforward to wire through an option, or simply extend the default - would you be able to try making a PR for that? If not I can make the update this week as well.
I guess my implement is still buggy, because I use vite-plugin-jspm
with options:
export default defineConfig(({ mode }) => {
return {
plugins: [
vue(),
vueJsx(),
jspmPlugin({
fetchOptions: {
timeout: 10000,
maxSockets: 4,
},
defaultProvider: 'unpkg',
debug: true
}),
],
Then still received:
C:\Users\test\Documents\MBDownload\frontend\node_modules\.pnpm\registry.npmmirror.com+minipass-fetch@1.4.1\node_modules\minipass-fetch\lib\index.js:110
reject(new FetchError(`request to ${request.url} failed, reason: ${
^
FetchError: request to https://unpkg.com/element-plus@2.3.9/theme-chalk/el-message.css failed, reason: Socket timeout
at ClientRequest.<anonymous> (C:\Users\test\Documents\project\frontend\node_modules\.pnpm\registry.npmmirror.com+minipass-fetch@1.4.1\node_modules\minipass-fetch\lib\index.js:110:14)
at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:502:9)
at TLSSocket.emit (node:events:525:35)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'ERR_SOCKET_TIMEOUT',
timeout: 4000,
errno: 'ERR_SOCKET_TIMEOUT',
type: 'system'
}
Node.js v18.15.0
ELIFECYCLE Command failed with exit code 1.
ERROR: "build-prod" exited with 1.
ELIFECYCLE Command failed with exit code 1.
Could you please help review the whole function calling chain? I am not talented at JavaScript.
@Bisstocuz ahh, looking at the stack more carefully we don't actually use minipass-fetch
so that is likely used specifically in the Vite plugin or Vite fetch implementation.
@Bisstocuz ahh, looking at the stack more carefully we don't actually use
minipass-fetch
so that is likely used specifically in the Vite plugin or Vite fetch implementation.
@JayaKrishnaNamburu Hey do you have any ideas about this issue?
@Bisstocuz can you try using the latest vite-plugin-jspm@0.5.1
. It uses the latest @jspm/generator@1.1.10
which supports fetchOptions
https://www.npmjs.com/package/vite-plugin-jspm?activeTab=code https://github.com/jspm/generator/releases/tag/1.1.10
@Bisstocuz can you try using the latest
vite-plugin-jspm@0.5.1
. It uses the latest@jspm/generator@1.1.10
which supportsfetchOptions
https://www.npmjs.com/package/vite-plugin-jspm?activeTab=code https://github.com/jspm/generator/releases/tag/1.1.10
I don't know why it reported:
ERR_PNPM_NO_MATCHING_VERSION No matching version found for vite-plugin-jspm@0.5.1
This error happened while installing a direct dependency of C:\Users\test\Documents\MBDownload\frontend
The latest release of vite-plugin-jspm is "0.5.0".
If you need the full list of all 8 published versions run "$ pnpm view vite-plugin-jspm versions".
That's a bit weird, given it is already available in npm
🤔
Any updates on this @Bisstocuz, were you able to make it work
Any updates on this @Bisstocuz, were you able to make it work
Still error, I am planned to check this issue several days later.
I'm using
vite-plugin-jspm
to build app.I tried visit
https://unpkg.com/element-plus@2.3.8/es/components/drawer/index.mjs
later, it responses successfully after several seconds.Is there any options to set timeout?