Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

357
Views
Quisiera saber como instalar y usar mathlive en NuxtJS

por favor ayúdenme me gustaría saber por qué no funciona o si lo estoy haciendo mal.

I npm i mathlive para obtener información. Y seguir la implementación de los complementos nuxt en la documentación no funciona.

nuxt.config.js

 export default { // Global page headers: https://go.nuxtjs.dev/config-head head: { title: 'Nuxtnumer', htmlAttrs: { lang: 'en', }, meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: '' }, { name: 'format-detection', content: 'telephone=no' }, ], link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }], }, // Global CSS: https://go.nuxtjs.dev/config-css css: [], // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins plugins: ['./plugins/mathlive-vue.js'], // Auto import components: https://go.nuxtjs.dev/config-components components: true, // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules buildModules: [], // Modules: https://go.nuxtjs.dev/config-modules modules: [ // https://go.nuxtjs.dev/bootstrap 'bootstrap-vue/nuxt', // https://go.nuxtjs.dev/axios '@nuxtjs/axios', ], // Axios module configuration: https://go.nuxtjs.dev/config-axios axios: { // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308 baseURL: '/', }, // Build Configuration: https://go.nuxtjs.dev/config-build build: { transpile: ['mathlive-vue'] }, }

archivo mathlive-vue.js en complementos de directorio

 import Vue from 'vue'; import * as Mathlive from 'mathlive'; import Mathfield from 'mathlive/dist/vue-mathlive.mjs' Vue.use(Mathlive,Mathfield)

Error:

ERROR Error al compilar con 1 errores errores amistosos 19:26:11

ERROR en ./node_modules/mathlive/dist/vue-mathlive.mjs errores amistosos 19:26:11

El análisis del módulo falló: Token inesperado (2:342) errores amistosos 19:26:11
Es posible que necesite un cargador apropiado para manejar este tipo de archivo, actualmente no hay cargadores configurados para procesar este archivo. Consulte https://webpack.js.org/concepts#loaders | /** MathLive 0.69.11 */

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No he usado Mathlive específicamente, pero leí tu pregunta y sospeché que:

 transpile: ['mathlive-vue']

Debiera ser:

 transpile: ['vue-mathlive']

porque la salida se queja de ./node_modules/mathlive/dist/vue-mathlive.mjs específicamente.

Hice girar una aplicación rápida y pude recrear su error copiando su configuración de transpile. Cambiar a vue-mathline resolvió el error por mí.

En caso de que usted (o cualquier otra persona que encuentre esta pregunta) se pregunte qué está pasando, el código de Mathlive usa módulos ES, que no se pueden ejecutar en Node (el lado del servidor de su aplicación Nuxt). Por lo tanto, debe informar a Nuxt que esos archivos deben transpilarse (hacerse compatibles con el nodo) para que funcionen.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!