use-shopping-cart
use-shopping-cart copied to clipboard
Bad export of validateCartItems from use-shopping-cart/src/serverUtil in docs
In some places in the documentation, the validateCartItems
function is exported from use-shopping-cart/src/serverUtil
, which does not seem to export that function. Could possibly be related to webpack config or something, but this error appears in a vanilla next.js (with TS) project.
The serverless docs pages does show the proper import though: 'use-shopping-cart/utilities'
PS. seems that the function is missing its parentheses in the docs page menu:
@GGAlanSmithee thank you for flagging this! Gonna take a look, sorry about the confusion and errors
@dayhaysoos my pleasure, thanks for this very nice package!
this was an issue for me too. The documentation has been hard to follow. I located it in the utilities/serverless.js file which is fine but there's no mention of the change in the docs. I changed my require statement but I'm still getting an errorMessage "errorMessage":"Package subpath './utilities/serverless' is not defined by "exports"
not sure what to do about this
on the side note, I was really glad when you gave the serverless functions example. It was helpful.
Hey @JBusani I had the same error message... the following import statement worked for me:
const { validateCartItems } = require("use-shopping-cart/utilities")