wobsoriano / trpc-nuxt

End-to-end typesafe APIs in Nuxt applications.
trpc-nuxt.vercel.app
MIT License
684 stars 39 forks source link

Could not resolve "#imports" #181

Closed felix-dolderer closed 3 months ago

felix-dolderer commented 3 months ago

When following the getting started guide from the docs, I'm getting the following error:

✘ [ERROR] Could not resolve "#imports"

    node_modules/trpc-nuxt/dist/client/index.mjs:22:93:
      22 │ import { getCurrentInstance, onScopeDispose, useAsyncData, toValue, ref, isRef, toRaw } from "#imports";
         ╵                                                                                              ~~~~~~~~~~

  You can mark the path "#imports" as external to exclude it from the bundle, which will remove this
  error and leave the unresolved path in the bundle.

Related: https://github.com/nuxt/nuxt/issues/28562

Reproduction: https://stackblitz.com/edit/github-rakia6

felix-dolderer commented 3 months ago

My bad on this one. I missed basically the first thing on the install page...

wobsoriano commented 3 months ago

Yeah @felix-dolderer 😆 tbh it would be nice if we could just add trpc-nuxt to modules array, but can't justify how trpc-nuxt can be a module with all this custom configuration in both client and server

felix-dolderer commented 3 months ago

@wobsoriano Makes sense.

It may be worth it to copy the nuxtConfig section from the install page to the usage sections of the docs as well, in case I'm not the only one who overlooked that part and went straight to the usage.