【问题标题】:Module not found: Error: Can't resolve './firebase' in 'C:未找到模块:错误:无法在“C:”中解析“./firebase”
【发布时间】:2018-08-11 16:52:33
【问题描述】:

我在我的 vuejs webApp 中遇到了这个错误,希望有人告诉我如何解决它:

./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?
type=script&index=0!./src/components/Envio.vue
Module not found: Error: Can't resolve './firebase' in 
'C:\Users\#####\Desktop\#####\src\components'
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?
type=script&index=0!./src/components/Envio.vue 17:0-32
 @ ./src/components/Envio.vue
 @ ./src/routes.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-
 server ./src/main.js

这是我的 vue 文件中的脚本:

<script>

import { db } from './firebase'

    export default {
      data: {
    mensaje: null,
 ... }
}
</script>

【问题讨论】:

    标签: firebase vue.js vuefire


    【解决方案1】:

    我假设您已经使用npm 命令通过节点包管理器安装了firebase。如果是这样,下面的 import 语句应该可以解决问题。

    import { db } from 'firebase'
    

    【讨论】:

      猜你喜欢
      • 2020-08-20
      • 2022-10-05
      • 2017-12-18
      • 2017-03-22
      • 2020-09-16
      • 2021-07-04
      • 2017-04-18
      • 2019-12-26
      • 2019-01-31
      相关资源
      最近更新 更多