atinux / atidone

A full-stack application with Auth, SSR and SQL, running on the edge with Nuxt.
https://todos.nuxt.dev
MIT License
690 stars 68 forks source link

Can not run locally via pnpm dev - Package import specifier "#internal/nitro/virtual/app-config" is not defined #25

Closed gwynhokkers closed 1 month ago

gwynhokkers commented 2 months ago

I' m having an issue running this locally, strangely it deploys fine to Cloudflare - but I am unable to run it via dev.

ERROR  [worker reload] [worker init] Package import specifier "#internal/nitro/virtual/app-config" is not defined in package /Users/gh/Documents/code/nuxt/edge-todo/node_modules/.pnpm/nitropack@2.9.7_drizzle-orm@0.31.2_@cloudflare+workers-types@4.20240725.0__magicast@0.3.4/node_modules/nitropack/package.json imported from /Users/gh/Documents/code/nuxt/edge-todo/node_modules/.pnpm/nitropack@2.9.7_drizzle-orm@0.31.2_@cloudflare+workers-types@4.20240725.0__magicast@0.3.4/node_modules/nitropack/dist/runtime/config.mjs

This is a fresh install cloned directly from the repo.

Package.json

{
  "private": true,
  "scripts": {
    "dev": "nuxi dev",
    "build": "nuxi build",
    "preview": "nuxt preview",
    "db:generate": "drizzle-kit generate",
    "lint": "eslint .",
    "postinstall": "nuxt prepare"
  },
  "dependencies": {
    "@iconify-json/simple-icons": "^1.1.107",
    "@nuxt/eslint": "^0.3.13",
    "@nuxt/ui": "^2.17.0",
    "@nuxthub/core": "^0.7.0",
    "drizzle-kit": "^0.22.7",
    "drizzle-orm": "0.31.2",
    "h3-zod": "^0.5.3",
    "nuxt": "^3.12.2",
    "nuxt-auth-utils": "^0.1.0",
    "zod": "^3.23.8"
  },
  "devDependencies": {
    "@nuxt/devtools": "^1.3.7",
    "@nuxt/eslint-config": "^0.3.13",
    "eslint": "^9.5.0",
    "typescript": "5.5.2",
    "wrangler": "^3.62.0"
  }
}

Running on an M2 2022 MacBook Air. Tried on Node: v22.5.1 and v20.16.0 using pnpm v9.6.0

I have a similar issue trying to run the nuxt-ui-pro/docs template.

atinux commented 1 month ago

Hey @gwynhokkers

Sorry about this issue, this is quite annoying when it happens. Did you try to remove your node_modules, .nuxt and lock file and install again?

gwynhokkers commented 1 month ago

Hi @Atinux
I was actually having the same issue elsewhere with a different repo - the nuxt pro docs starter.
I did all the usual, delete node_modules, lock files and .nuxt files, still no good.

I cloned the starter to a new directory and still no good. In the end the only thing that worked was creating a new directory outside of where all my other code repos were stored and install it there. Not sure why this would cause issues but seemed to be that Nuxt was just refusing to use v4 compatibility mode when in the same parent directory as my other repos. Odd - and I'm still not sure why.

atinux commented 1 month ago

Could you try with latest dependencies? 🤞

gwynhokkers commented 1 month ago

Quick update - cloned the repo to another folder and seems to be working well now. Looking forward to playing around with it soon!

AlekseiAQ commented 3 weeks ago

I'm facing the same issue, moving folders haven't helped.

Same for the github.com/barbapapazes/gavarnie project. Same issue for the versions in the projects and with latest dependency versions as well.

MacBook Air M1 node v22.8.0 pnpm 9.9.0

atinux commented 2 weeks ago

What command to you use to run @AlekseiAQ ?

AlekseiAQ commented 2 weeks ago

@atinux

pnpm dev

I've created an issue here https://github.com/nuxt-hub/core/issues/274, I see it across multiple projects.