Solved: “Uncaught Error: Call to a member function getPackage()” [Magento 2.3.0]
Magento 2.3.0 was released on November 28, 2018. Owing to the excellent features it offered, the Magento 2 store owners were bound to upgrade their store to the latest version!
However, some of them faced a theme error “Uncaught Error: Call to a member function getPackage()” in Magento 2.3. 0 while static content deployment. If you are one of them, you may have seen an error like this when you run the command:
php bin/magento setup:static-content:deploy -f
If that’s the case, continue reading for the solution!
Methods to solve “Uncaught Error: Call to a member function getPackage()” in Magento 2.3.0:
Method 1:
Run the below command
rm -rf pub/static/* var/view_preprocessed/pub/*
php bin/magento setup:static-content:deploy -f
Method 2:
email.css and email-inline.css are available in your custom theme
Open that css file and replace the code:
1 |
@import url("{{base_url_path}}frontend/Magento/luma/{{locale}}/css/email-fonts.css"); |
with,
1 |
@import url("{{baseUrl}}/css/email-fonts.css"); |
Run the below command:
php bin/magento setup:static-content:deploy -f
With any of the above methods, you can solve this theme related error in Magento 2.3.0
Please feel free to post your doubts in the Comments section below and I’d be happy to help 🙂
Do not hesitate to rate the post with 5 stars, encouraging us to deliver more such useful solutions!
Thank you.
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
8 Comments
Great!! it helps!
Hello Chandraprakash,
That’s great to know that 🙂
Thank You
Sanjay saves the day (again)! ⭐️🚀😁
Hello Barnaby,
I’m glad to help you out.
Thank You
Hi Sanjay! Thanks for your post, this working fine! 😀 almost went crazy with this error.
Hey Marc,
I’m glad it was helpful.
Thank you for the appreciation 🙂
did the same but no luck in custom theme
Please mention the error that you are facing.