Comments (7)
I have the same issue.
ERROR Cannot restart nuxt: serialize is not defined 00:54:35
at eval (eval at <anonymous> (node_modules\.pnpm\[email protected]\node_modules\lodash.template\index.js:1550:12), <anonymous>:7:1)
at compileTemplate (/node_modules/.pnpm/@[email protected]_xksk6ykcssmhab4dbdyjruocau/node_modules/@nuxt/kit/dist/index.mjs:511:45)
at async /node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1565:22
at async Promise.all (index 16)
at async generateApp (/node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1564:3)
at async _applyPromised (/node_modules/.pnpm/[email protected]/node_modules/perfect-debounce/dist/index.mjs:54:10)
ERROR [unhandledRejection] serialize is not defined 00:54:35
at eval (eval at <anonymous> (node_modules\.pnpm\[email protected]\node_modules\lodash.template\index.js:1550:12), <anonymous>:7:1)
at compileTemplate (/node_modules/.pnpm/@[email protected]_xksk6ykcssmhab4dbdyjruocau/node_modules/@nuxt/kit/dist/index.mjs:511:45)
at async /node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1565:22
at async Promise.all (index 16)
at async generateApp (/node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1564:3)
at async _applyPromised (/node_modules/.pnpm/[email protected]/node_modules/perfect-debounce/dist/index.mjs:54:10)
serialize is not defined here.
https://github.com/nicolasbeauvais/vue-social-sharing/blob/next/nuxt/vue-social-sharing-plugin.template.js.tpl#L5
import Vue from 'vue';
import VueSocialSharing from 'vue-social-sharing';
// Initialize VueSocialSharing and set custom sharing networks if specified
Vue.use(VueSocialSharing, [<%= serialize(options) %>][0]);
workaround solution
add vue-social-sharing.ts
to /plugins
import VueSocialSharing from 'vue-social-sharing'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(VueSocialSharing)
})
Remove:
// In your nuxt.config.js file:
modules: [
'vue-social-sharing/nuxt'
]
from vue-social-sharing.
I have the same issue.
ERROR Cannot restart nuxt: serialize is not defined 00:54:35 at eval (eval at <anonymous> (node_modules\.pnpm\[email protected]\node_modules\lodash.template\index.js:1550:12), <anonymous>:7:1) at compileTemplate (/node_modules/.pnpm/@[email protected]_xksk6ykcssmhab4dbdyjruocau/node_modules/@nuxt/kit/dist/index.mjs:511:45) at async /node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1565:22 at async Promise.all (index 16) at async generateApp (/node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1564:3) at async _applyPromised (/node_modules/.pnpm/[email protected]/node_modules/perfect-debounce/dist/index.mjs:54:10) ERROR [unhandledRejection] serialize is not defined 00:54:35 at eval (eval at <anonymous> (node_modules\.pnpm\[email protected]\node_modules\lodash.template\index.js:1550:12), <anonymous>:7:1) at compileTemplate (/node_modules/.pnpm/@[email protected]_xksk6ykcssmhab4dbdyjruocau/node_modules/@nuxt/kit/dist/index.mjs:511:45) at async /node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1565:22 at async Promise.all (index 16) at async generateApp (/node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1564:3) at async _applyPromised (/node_modules/.pnpm/[email protected]/node_modules/perfect-debounce/dist/index.mjs:54:10)
serialize is not defined here. https://github.com/nicolasbeauvais/vue-social-sharing/blob/next/nuxt/vue-social-sharing-plugin.template.js.tpl#L5
import Vue from 'vue'; import VueSocialSharing from 'vue-social-sharing'; // Initialize VueSocialSharing and set custom sharing networks if specified Vue.use(VueSocialSharing, [<%= serialize(options) %>][0]);
workaround solution add
vue-social-sharing.ts
to/plugins
import VueSocialSharing from 'vue-social-sharing' export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.use(VueSocialSharing) })Remove:
// In your nuxt.config.js file: modules: [ 'vue-social-sharing/nuxt' ]
change the file name vue-social-sharing.ts
to vue-social-sharing.client.ts
from vue-social-sharing.
Thank you @shtse8 for this.
I think you should open a PR to add the workaround on the docs
from vue-social-sharing.
Thank you @shtse8 for the quick fix. However, I do notice a warning on the server side:
Failed to resolve component: ShareNetwork If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
I've attempted to fix it by modifying next.config.ts
with:
vue: {
compilerOptions: {
isCustomElement: (tag: string) => ["ShareNetwork"].includes(tag),
},
},
vite: {
build: {
rollupOptions: {
plugins: [
//lifted from https://github.com/rollup/rollup/issues/4090
{
name: "disable-treeshake",
transform(code, id) {
if (
/node_modules[/]vue-social-sharing/.test(id)
) {
// Disable tree shake for vue-social-sharing module
return {
code,
map: null,
moduleSideEffects: "no-treeshake",
};
}
return null;
},
},
],
},
},
},
But the above modification results in an unclickable ''. Could you please share how did you managed to make it run on Vue3 + Nuxt3?
from vue-social-sharing.
I have the same issue.
ERROR Cannot restart nuxt: serialize is not defined 00:54:35 at eval (eval at <anonymous> (node_modules\.pnpm\[email protected]\node_modules\lodash.template\index.js:1550:12), <anonymous>:7:1) at compileTemplate (/node_modules/.pnpm/@[email protected]_xksk6ykcssmhab4dbdyjruocau/node_modules/@nuxt/kit/dist/index.mjs:511:45) at async /node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1565:22 at async Promise.all (index 16) at async generateApp (/node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1564:3) at async _applyPromised (/node_modules/.pnpm/[email protected]/node_modules/perfect-debounce/dist/index.mjs:54:10) ERROR [unhandledRejection] serialize is not defined 00:54:35 at eval (eval at <anonymous> (node_modules\.pnpm\[email protected]\node_modules\lodash.template\index.js:1550:12), <anonymous>:7:1) at compileTemplate (/node_modules/.pnpm/@[email protected]_xksk6ykcssmhab4dbdyjruocau/node_modules/@nuxt/kit/dist/index.mjs:511:45) at async /node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1565:22 at async Promise.all (index 16) at async generateApp (/node_modules/.pnpm/[email protected]_i6nlvakzchf2ijsj2wbufpcjqi/node_modules/nuxt/dist/index.mjs:1564:3) at async _applyPromised (/node_modules/.pnpm/[email protected]/node_modules/perfect-debounce/dist/index.mjs:54:10)
serialize is not defined here. https://github.com/nicolasbeauvais/vue-social-sharing/blob/next/nuxt/vue-social-sharing-plugin.template.js.tpl#L5
import Vue from 'vue'; import VueSocialSharing from 'vue-social-sharing'; // Initialize VueSocialSharing and set custom sharing networks if specified Vue.use(VueSocialSharing, [<%= serialize(options) %>][0]);
workaround solution add
vue-social-sharing.ts
to/plugins
import VueSocialSharing from 'vue-social-sharing' export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.use(VueSocialSharing) })Remove:
// In your nuxt.config.js file: modules: [ 'vue-social-sharing/nuxt' ]
After this fix it starts working but show warn in console
from vue-social-sharing.
Thank you @shtse8 for the quick fix. However, I do notice a warning on the server side:
Failed to resolve component: ShareNetwork If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
I've attempted to fix it by modifying
next.config.ts
with:vue: { compilerOptions: { isCustomElement: (tag: string) => ["ShareNetwork"].includes(tag), }, }, vite: { build: { rollupOptions: { plugins: [ //lifted from https://github.com/rollup/rollup/issues/4090 { name: "disable-treeshake", transform(code, id) { if ( /node_modules[/]vue-social-sharing/.test(id) ) { // Disable tree shake for vue-social-sharing module return { code, map: null, moduleSideEffects: "no-treeshake", }; } return null; }, }, ], }, }, },
But the above modification results in an unclickable ''. Could you please share how did you managed to make it run on Vue3 + Nuxt3?
Did you manage to fix this error? Im facing the same when using Nuxt 3 SSR
[Vue warn]: Failed to resolve component: ShareNetwork
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Component <Anonymous> is missing template or render function.
from vue-social-sharing.
Related Issues (20)
- messenger link expired HOT 1
- Chrome and Windows Edge blocking twitter share
- it still renders an `<a>` tag by default. it's not renderless ? HOT 1
- Not working in nuxt 2.15.7 HOT 2
- Facebook URL does not get full path HOT 1
- Component not showing up correctly HOT 4
- Facebook description HOT 7
- Proper steps to configure in Laravel / IntertiaJs (vueJs v3)? HOT 1
- Lighthouse - Links are not crawlable HOT 5
- Email sharing in Safari and Firefox opens a blank tab HOT 1
- Messenger isn't working HOT 4
- Used in nuxt, the property “popup“” setting width and height are invalid
- Share to instagram HOT 1
- vue3 error ‘’Network fakeblock does not exist‘’ HOT 3
- How to add socials such as Tiktok, Twitch.tv using this library? HOT 1
- Pinterest Share Button Can't Work After Closing the Tab Open (Mobile Safari) HOT 1
- Nuxt3 nuxt.config.ts module error HOT 11
- Issue Uncaught DOMException: Permission denied to access property "__v_isRef" on cross-origin object HOT 7
- LinkedIn share on mobile opens the App but doesnt share content HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-social-sharing.