Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

App extension code splitting

d_tehrani
Shopify Partner
56 1 13

When I tried to build my subscription app extension, I got this error.

Error: Error compiling: asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  main.js (291 KiB),entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (291 KiB)
      main.js

 

So I changed my code to use React.lazy and dynamic import, but now I get the error below.

TypeError: importScripts is not a function
    at http://localhost:39351/assets/extension.js?reload=0:817:14
    at async Promise.all (index 0)


I know this is a niche issue but I would appreciate it if someone could provide information about how to deal with this.

And please tell me if I need to provide more information. Thanks.

Replies 2 (2)

Chong1
New Member
4 0 0

Hey, there seems to be a problem with the argo extension. The same thing is going on for me too. I am able to compile but unable to push the code to shopify. 

ericute
Shopify Partner
50 3 6

Hi, @d_tehrani.

 

Have you ever figured out the solution to this problem of yours? I'm experiencing it now. Thanks!