storyblok / storyblok-vue

Vue.js SDK for Storyblok CMS
MIT License
95 stars 20 forks source link

Could not resolve "#app" #13

Closed dissy123 closed 9 months ago

dissy123 commented 2 years ago

Dear Storyblok Team,

I get an Error when using @storyblok/nuxt v3. But it's also working with the error, I'm relativly new to Vue.

 WARN  @storyblok/nuxt doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.

[Vue warn]: Failed to resolve component: Nuxt
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Failed to resolve component: Nuxt
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
 > node_modules/@storyblok/nuxt/composables/dist/composables.mjs:1:27: error: Could not resolve "#app" (mark it as external to exclude it from the bundle)
    1 │ import { useNuxtApp } from "#app";
      ╵                            ~~~~~~

 ERROR  09:37:35 [vite] error while updating dependencies:                                                                       09:37:35
Error: Build failed with 1 error:
node_modules/@storyblok/nuxt/composables/dist/composables.mjs:1:27: error: Could not resolve "#app" (mark it as external to exclude it from the bundle)
    at failureErrorWithLog (\nuxt3-tailwind3-starter-main\node_modules\vite\node_modules\esbuild\lib\main.js:1493:15)
    at \nuxt3-tailwind3-starter-main\node_modules\vite\node_modules\esbuild\lib\main.js:1151:28
    at runOnEndCallbacks \nuxt3-tailwind3-starter-main\node_modules\vite\node_modules\esbuild\lib\main.js:941:63)
    at buildResponseToResult (\nuxt3-tailwind3-starter-main\node_modules\vite\node_modules\esbuild\lib\main.js:1149:7)
    at D:\00_Firma\00_dev_library\nuxt3-tailwind3-starter-main\node_modules\vite\node_modules\esbuild\lib\main.js:1258:14
    at D:\00_Firma\00_dev_library\nuxt3-tailwind3-starter-main\node_modules\vite\node_modules\esbuild\lib\main.js:629:9
    at handleIncomingPacket (\nuxt3-tailwind3-starter-main\node_modules\vite\node_modules\esbuild\lib\main.js:726:9)
    at Socket.readFromStdout (\nuxt3-tailwind3-starter-main\node_modules\vite\node_modules\esbuild\lib\main.js:596:7)
    at Socket.emit (node:events:390:28)
    at Socket.emit (node:domain:475:12)
liamcharmer commented 2 years ago

I also get this same issue, have you came up with any solution @dissy123 ?

jprataciertocom commented 2 years ago

@liamcharmer @dissy123

If it is similar to the storyblock NuxtJs bug, try to use:

 build: {
    transpile: [
      '#app',
    ],
  }
Dawntraoz commented 9 months ago

Closing this issue since it was in an old version of the module. If you happen to face it again, please create a new one with a reproduction environment. Thanks a lot 💜