Open robregonm opened 5 months ago
API Platform version(s) affected: 3.2.18
Description Clients generated for Nuxt will fail with: "Cannot stringify arbitrary non-POJOs"
How to reproduce
yarn create @api-platform/client https://localhost/ . --generator nuxt --resource animal
Possible Solution
nuxt.config.js
experimental: { renderJsonPayloads: false, },
./nuxt/stores/animal/list.ts
shallowRef()
setHubUrl
setHubUrl(hubUrl?: URL) { this.hubUrl = shallowRef(hubUrl); },
./composables/api.ts
shallowRef() to all
Additional Context This is occurring with all projects using Nuxt 3.4 or later. More info at: https://nuxt.com/blog/v3-4#payload-enhancements
Hello @robregonm I think we could just store the URL as a string and not as a URL object, what do you think?
@J3m5 That's another good and simple workaround. Agree.
API Platform version(s) affected: 3.2.18
Description
Clients generated for Nuxt will fail with: "Cannot stringify arbitrary non-POJOs"
How to reproduce
yarn create @api-platform/client https://localhost/ . --generator nuxt --resource animal
)Possible Solution
nuxt.config.js
and add the following:./nuxt/stores/animal/list.ts
and addshallowRef()
tosetHubUrl
function:./composables/api.ts
and addshallowRef() to all
onResponse()` functions.Additional Context
This is occurring with all projects using Nuxt 3.4 or later. More info at: https://nuxt.com/blog/v3-4#payload-enhancements