John-Weeks-Dev / aliexpress-clone

This is an AliExpress Clone E-commerce site built with Nuxt 3, Vue JS, Supabase, Stripe, Tailwind CSS, Prisma, Pinia, and hosted on Netlify
https://youtube.com/watch?v=dVcCRFVhz74
164 stars 54 forks source link

Error asking for index.html #1

Open Divesh-Kumar-Chordia opened 1 year ago

Divesh-Kumar-Chordia commented 1 year ago

nuxt] Could not resolve id pinia-plugin-persistedstate C:... \JohnWeekDev\aliExpressClone\index.html 2:09:22 pm

// https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ devtools: { enabled: true }, pages:true, modules:[ 'nuxt-icon', 'nuxt-lodash', '@pinia/nuxt', '@pinia-plugin-persistedstate/nuxt', '@nuxtjs/tailwindcss', // '@nuxtjs/supabase' ], runtimeConfig: { public: { stripePk:process.env.STRIPE_PK_KEY, } }, app:{ head:{ script:[ {src:'https://js.stripe.com/v3/',defer:true} ], } } })

{ "name": "nuxt-app", "private": true, "scripts": { "build": "nuxt build", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare" }, "prisma": { "seed": "node prisma/seed.js" }, "devDependencies": { "@nuxt/devtools": "latest", "@pinia-plugin-persistedstate/nuxt": "^1.1.1", "nuxt": "^3.7.0" }, "dependencies": { "@nuxtjs/supabase": "^1.0.2", "@nuxtjs/tailwindcss": "^6.8.0", "@pinia/nuxt": "^0.4.11", "@prisma/client": "^5.2.0", "@stripe/stripe-js": "^2.1.0", "nuxt-icon": "^0.5.0", "nuxt-lodash": "^2.5.0", "pinia": "^2.1.6", "prisma": "^5.2.0", "stripe": "^13.3.0" } }

Divesh-Kumar-Chordia commented 1 year ago

this are the nuxt.config and package.json file .

peterstnsz commented 1 year ago

@Divesh-Kumar-Chordia this is not related to index.html but to pinia-plugin-persistedstate.

In your nuxt.config.ts add this line

  build: {
    transpile: ['pinia-plugin-persistedstate'],
  },

Here's a source of this workaround: https://github.com/prazdevs/pinia-plugin-persistedstate/issues/236#issuecomment-1712104845