storyblok-vue icon indicating copy to clipboard operation
storyblok-vue copied to clipboard

Could not resolve "#app"

Open dissy123 opened this issue 3 years ago • 2 comments

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)

dissy123 avatar Jan 14 '22 08:01 dissy123

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

liamcharmer avatar Mar 01 '22 18:03 liamcharmer

@liamcharmer @dissy123

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

 build: {
    transpile: [
      '#app',
    ],
  }

jprataciertocom avatar Mar 28 '22 11:03 jprataciertocom

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 💜

Dawntraoz avatar Mar 05 '24 14:03 Dawntraoz