-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
This relative module was not found: ./index.vue?vue&type=script&lang=ts& in ./pages/index.vue #8015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have a same problem too. A new project with Typescript failed to compile after creating the project.
|
cc @kevinmarrec |
Just install @nuxt/typescript-runtime like so:
|
@nuxt/typescript-runtime is installed in dependencies when i am install nuxt please look at the one above package.json |
Ah, sry, my bad. But it seems like outdated for me, try to upgrade it to "@nuxt/typescript-runtime": "^2.0.0", |
i am installed it according to the offical document the day before yesterday, |
Agree, I've got same troubles - after setup according to the official doc, there was not typescript-runtime package at all, I've got errors like @sontd-0882 have ./index.vue?vue&type=script&lang=ts& in ./pages/index.vue friendly-errors 17:03:01 which is disappeared after I installed latest typescript-runtime So my package.json now is like:
But definitely something is wrong here, thanks for opening this issue. Will wait for the official reply |
en, waiting for official reply |
Yes, this is an issue with the wrong version of The fix has already been merged but not yet released: nuxt/create-nuxt-app#599 |
1. Project generated using 'yarn create nuxt-app' with the following choices: - Project name: website-starter - Programming language: TypeScript - Package manager: Yarn - UI framework: Tailwind CSS - Nuxt.js modules: Axios, Progressive Web App (PWA), Content - Linting tools: ESLint, Prettier - Testing framework: None - Rendering mode: Universal (SSR / SSG) - Deployment target: Static (Static/JAMStack hosting) - Development tools: None 2. Apply unreleased fix with generated project: nuxt/nuxt#8015 3. Update README.md
Is there a functional workaround for this? I'm still seeing the issue. I deleted my
Still no luck. Any tips are appreciated. Thanks! |
@JeffJassky You should likely no longer need |
Adding to the comment from @danielroe, if you are still encountering this issue make sure that your typescript version matches that of I also mentioned this in more detail here: |
I'm facing the same issue: {
"name": "poc",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxt/content": "^1.15.1",
"@nuxtjs/axios": "^5.13.6",
"bootstrap": "^4.6.1",
"bootstrap-vue": "^2.21.2",
"core-js": "^3.19.3",
"nuxt": "^2.15.8",
"vue": "^2.6.14",
"vue-server-renderer": "^2.6.14",
"vue-template-compiler": "^2.6.14",
"webpack": "^4.46.0"
},
"devDependencies": {
"@nuxt/types": "^2.15.8",
"@nuxt/typescript-build": "^2.1.0",
"@nuxt/typescript-runtime":"^2.1.0"
}
} ...and I downgraded typescript to the required version for the dev dependencies: $ tsc --version
Version 4.2.4 and still get the error ERROR Failed to compile with 1 errors friendly-errors 12:22:39
This relative module was not found: friendly-errors 12:22:39
friendly-errors 12:22:39
* ./index.vue?vue&type=script&lang=ts& in ./pages/index.vue Any other suggestions for how to fix this? |
Running the same installation today: {
"name": "poc",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxt/content": "^1.15.1",
"@nuxtjs/axios": "^5.13.6",
"bootstrap": "^4.6.1",
"bootstrap-vue": "^2.21.2",
"core-js": "^3.19.3",
"nuxt": "^2.15.8",
"vue": "^2.6.14",
"vue-server-renderer": "^2.6.14",
"vue-template-compiler": "^2.6.14",
"webpack": "^4.46.0"
},
"devDependencies": {
"@nuxt/types": "^2.15.8",
"@nuxt/typescript-build": "^2.1.0"
}
} but with updated typescript version: $ tsc --version
Version 4.5.5 Seems to have resolve the issue. |
Using typescript version 4.5.5 with "@nuxt/types": "^2.15.8",
"@nuxt/typescript-build": "^2.1.0",
"typescript": "^4.5.5", didn't solve the issue for me. |
I confirm. Still doesn't work. |
Try using yarn resolutions or npm overrides to ensure you have only one TypeScript version installed in your project. |
How would we go about doing this please? Having the same issue as other's above from fresh installs |
I'm having the same issue |
I fixed it by following these steps:
After doing this, the server and client compiled without any issues. |
just add a key in your {
"dependencies": { ... },
"resolutions": {
"typescript": "*"
} This will ensure that only 1 version of typescript is installed. But I'm not exactly sure how that is achieved. Eg: in my case, |
Uh oh!
There was an error while loading. Please reload this page.
Versions
Reproduction
Additional Details
Steps to reproduce
What is Expected?
i hope its run success!
What is actually happening?
but i am remove "lang=ts" from "<script lang='ts'>" of pages/index.vue , its ok!!!
but i am already install typescript global!
package.json
The text was updated successfully, but these errors were encountered: