nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
640 stars 98 forks source link

Types not working in subfolder #178

Closed JFGHT closed 4 years ago

JFGHT commented 4 years ago

When creating a Nuxt project in a subfolder npx create-nuxt-app test/src and then installing firebase and firebase-module, the module's types are not working correctly. A good use case for this is when you combine in the same project the Firebase functions folder then, you cannot have Nuxt in the root.

Steps to reproduce

1.- npx create-nuxt-app test/src 2.- Install firebase and firebase-module. 3.- Config src/tsconfig.json with @nuxtjs/firebase.

What is Expected?

To have firebase types injected into this.

What is actually happening?

They are not available.

lupas commented 4 years ago

Typescript with various projects in subfolders is a b**** anyway, I encountered other issues

This time I cannot reproduce it though. It's working for me. What is not working exactly? Typescript throwing errors or just vscode autocomplete?

Could you provide a minimal running example on codepen or let me know your tyepscript condig?

JFGHT commented 4 years ago

As simple as setting up a new Nuxt project. Then:

1.- Move all files into src folder except for package.json, yarn.lock and node_modules.

2.- Edit package json:

"scripts": {
    "dev": "nuxt src",
    "build": "nuxt build src",
    "start": "nuxt start src",
    "generate": "nuxt generate src"
}

3.- Install and configure @nuxtjs/firebase.

4.- Go to the default index.vue created by Nuxt in pages and check types are not injected.

JFGHT commented 4 years ago

Okay, fixed by creating a root tsconfig.json with:

{
  "extends": "./src/tsconfig.json"
}