Get Error: import Quasar from 'quasar' (1.0)


#1

I would like to tried Quasar Framework1.0 beta on Meteor.
But get error with

import Quasar from 'quasar'
Uncaught Error: Cannot find module 'quasar'
    at makeMissingError (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:232)
    at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:251)
    at Module.moduleLink [as link] (modules.js?hash=235183ca901a1e5610984473a56483095ea17662:285)
    at main.js (main.js:1)
    at fileEvaluate (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:346)
    at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:248)
    at require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:268)
    at app.js?hash=c6c5b9e948103b389f4f2ea5ebdac249dc26f90e:260

#2

Hey, I would recommend:
first: restarting meteor (I often get this error when I add a new package without restarting)
second: try installing it again with npm:

meteor npm install quasar

third: delete your node_modules directory and do a fresh meteor npm install
fourth: try a meteor reset
fifth: come back here because something else must be wrong


#3

Thanks for your reply, but still the same

1- npm remove --save quasar
2- meteor reset
3- rm -rf node_modules


1- meteor npm install --save quasar
2- meteor

modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:232 Uncaught Error: Cannot find module 'quasar'
    at makeMissingError (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:232)
    at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:251)
    at Module.moduleLink [as link] (modules.js?hash=d65c6a14915cae108e0d16ea907ab99c30d6bc43:285)
    at main.js (main.js:1)
    at fileEvaluate (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:346)
    at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:248)
    at require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:268)
    at app.js?hash=dd9f7b16d24f383743d98876d07fe5e2e48ecac7:308

My config

import { Meteor } from 'meteor/meteor'
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import Vuex from 'vuex'
Vue.use(Vuex)

// App layout
import AppLayout from '/src/layouts/App.vue'

// Quasar globally
import '@quasar/extras/material-icons/material-icons.css'
import 'quasar/dist/quasar.min.css'
import Quasar from 'quasar'
import langEn from 'quasar/lang/en-us'

Vue.use(Quasar, {
  lang: langEn,
})

// Router
import routes from '/src/routes'
const router = new VueRouter({
  mode: 'history',
  routes,
})

// Store
import createStore from '/src/store'
const store = new Vuex.Store(createStore)

//App start
Meteor.startup(() => {
  new Vue({
    router,
    store,
    render: h => h(AppLayout),
  }).$mount('app')
})

#4

Okay I took a look and quasar’s npm package doesn’t actually a usable module. The package.json file they include doesn’t have a main field and so doesn’t comply with the node modules spec.

Which is probably why the documentation for Quasar doesn’t say to install via npm:
https://quasar-framework.org/guide/index.html

I’d suggest following the documentation and/or get started guide of Quasar since they like to do things differently


#5

Excuse me, Could you join this issue