storyblok / storyblok-nuxt

Storyblok Nuxt module
https://www.storyblok.com/tp/nuxt-js-multilanguage-website-tutorial
MIT License
278 stars 44 forks source link

import { useNuxtApp } from "#app" error. #81

Closed rahalio closed 1 year ago

rahalio commented 2 years ago

Trying to build application and getting the below error:

node_modules/@storyblok/nuxt/composables/dist/composables.mjs:1:27: 1 │ import { useNuxtApp } from "#app"; ╵ ~~

You can mark the path "#app" as external to exclude it from the bundle, which will remove this error.

ERROR 2:50:46 a.m. [vite] error while updating dependencies: 02:50:46
Error: Build failed with 1 error: node_modules/@storyblok/nuxt/composables/dist/composables.mjs:1:27: ERROR: Could not resolve "#app"

tsiika commented 2 years ago

Which version of @storyblok/nuxt you are using? I'm having this very same issue in development build with @storyblok/nuxt@next version.

joshistoast commented 2 years ago

I too am on the next build

tsiika commented 2 years ago
{
    "dependencies": {
        "@fortawesome/fontawesome-svg-core": "1.2.36",
        "@fortawesome/pro-light-svg-icons": "^5.15.4",
        "@fortawesome/pro-regular-svg-icons": "^5.15.4",
        "@fortawesome/pro-solid-svg-icons": "^5.15.4",
        "@fortawesome/vue-fontawesome": "prerelease",
        "@pinia/nuxt": "^0.1.8",
        "@storyblok/nuxt": "next",
        "axios": "^0.26.0",
        "pinia": "^2.0.11",
        "tailwindcss": "^3.0.18",
        "vue": "next",
        "vue-router": "next"
    },
    "devDependencies": {
        "@types/eslint": "^8",
        "@typescript-eslint/eslint-plugin": "^5.10.1",
        "@typescript-eslint/parser": "^5.10.1",
        "autoprefixer": "latest",
        "eslint": "^8.0.0",
        "eslint-config-airbnb-base": "^15.0.0",
        "eslint-config-airbnb-typescript": "^16.1.0",
        "eslint-formatter-gitlab": "^3.0.0",
        "eslint-import-resolver-node": "^0.3.6",
        "eslint-import-resolver-typescript": "^2.5.0",
        "eslint-import-resolver-webpack": "^0.13.2",
        "eslint-plugin-import": "^2.25.4",
        "eslint-plugin-nuxt": "^3.1.0",
        "eslint-plugin-unicorn": "^41.0.0",
        "eslint-plugin-vue": "^8.3.0",
        "eslint-plugin-vuejs-accessibility": "^1.1.1",
        "nuxt3": "latest",
        "postcss": "latest",
        "sass": "^1.49.0",
        "sass-loader": "^12.4.0",
        "typescript": "^4.5.5",
        "vue-tsc": "^0.31.1"
    },
    "packageManager": "yarn@3.1.1"

My dependencies from package.json for reference which I'm having issues with.

rahalio commented 2 years ago

Which version of @storyblok/nuxt you are using? I'm having this very same issue in development build with @storyblok/nuxt@next version.

I am using "@storyblok/nuxt": "3.0.0-beta.3" with error

liamcharmer commented 2 years ago

Is there a workable version previously at all?

tsiika commented 2 years ago

Found possible workaround from issue #67 . This issue is going to be fixed in pull request #80.

Workaround

Just add following to nuxt.config.js

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

I got rid of the error by using this workaround. Hope it'll work for you too!

alvarosabu commented 1 year ago

Close due inactivity, if it's still relevant, please feel free to re-open