Skip to content

Type error with magento 2.4.5 #2483

@sanvisimo

Description

@sanvisimo

Describe the Bug

using magento 2.4.5 generate the error:

node_modules/@graphcommerce/google-datalayer/mapping/cartToPurchase/cartToPurchase.ts:23:32 - error TS18049: 'address.selected_shipping_method.price_excl_tax' is possibly 'null' or 'undefined'.

23       (sum, address) => sum + (address?.selected_shipping_method?.price_excl_tax.value ?? 0),

Expected Behavior

price_excl_tax is optional

To Reproduce

in the magento-open-source examplet use:

`// @ts-check

/**

module.exports = config
`
as graphcommerce.config.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions