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

Miss file content when release widget #3

Open
zsnmwy opened this issue Apr 19, 2023 · 2 comments
Open

Miss file content when release widget #3

zsnmwy opened this issue Apr 19, 2023 · 2 comments
Assignees

Comments

@zsnmwy
Copy link

zsnmwy commented Apr 19, 2023

I succeed in releasing the widget.

 *  正在执行任务: npm run release 


> release
> widget-cli release  --uploadHost http://192.168.31.221

release version [0.0.8]: 
v0.0.8

=== Compiling Widget ===
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  widget_bundle.min.js (367 KiB)
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  bundle (367 KiB)
      widget_bundle.min.js

webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
Compile Succeed: ./dist/packed/widget_bundle.min.js
compiling... done

=== Package Details ===
name:                发货
host:                http://192.168.31.221
packageId:           wpkQ3GjB7AVqW
spaceId:             spcfBgNl5rFQU
version:             0.0.8
releaseBundleSize:   367.34 kB
description          发货 description
icon                 ./package_icon.png
cover                ./cover.png
authorIcon           ./author_icon.png
authorLink           undefined
sandbox              true
releaseType          space

uploading bundle... done
uploading package assets... done
releasing... done
successful release widget [email protected]

But failed to load in the release widget.

image

image

image


And I found the file size just only 64k.

root@frappe:/tmp# wget http://192.168.31.221/assets/widget/wpkQ3GjB7AVqW/0.0.8/41219692cc574538b2362b20a16740f8.js
--2023-04-19 07:42:22--  http://192.168.31.221/assets/widget/wpkQ3GjB7AVqW/0.0.8/41219692cc574538b2362b20a16740f8.js
Connecting to 192.168.31.221:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 65536 (64K) [application/javascript]
Saving to: ‘41219692cc574538b2362b20a16740f8.js’

41219692cc574538b2362b20a16740f8.js        100%[=====================================================================================>]  64.00K  --.-KB/s    in 0s

2023-04-19 07:42:22 (346 MB/s) - ‘41219692cc574538b2362b20a16740f8.js’ saved [65536/65536]

root@frappe:/tmp# ls -lah 41219692cc574538b2362b20a16740f8.js
-rw-r--r-- 1 root root 64K Apr 19 07:34 41219692cc574538b2362b20a16740f8.js
$ ls -lah            
total 736
drwxr-xr-x  3 zsnmwy  staff    96B  4 19 15:34 .
drwxr-xr-x  4 zsnmwy  staff   128B  4 19 14:49 ..
-rw-r--r--  1 zsnmwy  staff   367K  4 19 15:34 widget_bundle.min.js

I replace the file through the minio console.

It's work.


The question may cause by the gateway.

https://github.com/apitable/apitable/blob/404dedbd55cd6a6a2a3288280fb16515e2e60c50/gateway/conf.d/default.conf#L25-L30


I use the docker-compose.yaml to deploy apitable.

https://github.com/apitable/apitable/blob/develop/docker-compose.yaml

@nagisakon
Copy link
Collaborator

Please check the code of your own widget.

@zsnmwy
Copy link
Author

zsnmwy commented Apr 19, 2023

Please check the code of your own widget.

My code is correct.
Here is my code.

My opinion is that OpenResty intercepts part of the contents of the file.

It works in dev mode.

It works after file replacement in the release stage.

image


If I release it and refresh the page I will get errors.

Note the size of the bundled file - 367 KiB

$ npm run release                                                                                 

> release
> widget-cli release  --uploadHost http://192.168.31.221

release version [0.0.9]: 
v0.0.9

=== Compiling Widget ===
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  widget_bundle.min.js (367 KiB)
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  bundle (367 KiB)
      widget_bundle.min.js

webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
Compile Succeed: ./dist/packed/widget_bundle.min.js
compiling... done

=== Package Details ===
name:                发货
host:                http://192.168.31.221
packageId:           wpkQ3GjB7AVqW
spaceId:             spcfBgNl5rFQU
version:             0.0.9
releaseBundleSize:   367.34 kB
description          发货 description
icon                 ./package_icon.png
cover                ./cover.png
authorIcon           ./author_icon.png
authorLink           undefined
sandbox              true
releaseType          space

uploading bundle... done
uploading package assets... done
releasing... done
successful release widget [email protected]

image

Just only 64k

image

image


Fix it

image

image

image

image

It works after file replacement in the release stage.


My opinion is that OpenResty intercepts part of the contents of the file.

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

No branches or pull requests

3 participants