问题描述

使用vue的i18n 出现很多warning提示

Module parse failed: Unexpected token (1:10)

You may need an appropriate loader to handle this file type.

| {"version":3,"sources":["webpack:///webpack/universalModuleDefinition"

问题出现的环境背景及自己尝试过哪些方法

"vue": "^2.5.16",

"vue-i18n": "^7.3.2",

"vue-loader": "^13.3.0",

"vue-router": "^3.0.1",

方法:

修改vue的版本没有什么用

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)

Module parse failed: Unexpected token (1:10)

You may need an appropriate loader to handle this file type.

| {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 9917dc3397fa2a2ff2ba","webpack:///./src/locale/lang.js","webpack:///external {\"root\":\"Vue\",\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"amd\":\"vue\"}","webpack:///./src/locale/lang/pt-PT.js"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE_1__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","lang","isServer","window","iview","langs","locale","Vue","$isServer","select","placeholder","noMatch","loading","table","noDataText","noFilteredDataText","confirmFilter","resetFilter","clearFilter","datepicker","selectDate","selectTime","startTime","endTime","clear","ok","datePanelLabel","month","month1","month2","month3","month4","month5","month6","month7","month8","month9","month10","month11","month12","year","weekStartDay","weeks","sun","mon","tue","wed","thu","fri","sat","months","m1","m2","m3","m4","m5","m6","m7","m8","m9","m10","m11","m12","transfer","titles","source","target","filterPlaceholder","notFoundText","modal","okText","cancelText","poptip","page","prev","next","total","item","items","prev5","next5","goto","rate","star","stars","tree","emptyText","default"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,QACA,mBAAAC,eAAAC,IACAD,OAAA,uBAAAJ,GACA,iBAAAC,QACAA,QAAA,gBAAAD,EAAAG,QAAA,QAEAJ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JC,eAAgB,mBAChBC,MAAO,MACPC,OAAQ,UACRC,OAAQ,YACRC,OAAQ,QACRC,OAAQ,QACRC,OAAQ,OACRC,OAAQ,QACRC,OAAQ,QACRC,OAAQ,SACRC,OAAQ,WACRC,QAAS,UACTC,QAAS,WACTC,QAAS,WACTC,KAAM,MACNC,aAAc,IACdC,OACIC,IAAK,MACLC,IAAK,MACLC,IAAK,MACLC,IAAK,MACLC,IAAK,MACLC,IAAK,MACLC,IAAK,OAETC,QACIC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,IAAK,MACLC,IAAK,MACLC,IAAK,QAGbC,UACIC,QACIC,OAAQ,SACRC,OAAQ,WAEZC,kBAAmB,gBACnBC,aAAc,kBAElBC,OACIC,OAAQ,YACRC,WAAY,YAEhBC,QACIF,OAAQ,YACRC,WAAY,YAEhBE,MACIC,KAAM,kBACNC,KAAM,iBACNC,MAAO,QACPC,KAAM,OACNC,MAAO,QACPC,MAAO,mBACPC,MAAO,oBACPP,KAAM,QACNQ,KAAM,UACNlF,EAAG,IAEPmF,MACIC,KAAM,UACNC,MAAO,YAEXC,MACIC,UAAW,gBAKvB,oDAtGA9G,EAAA,IAsGA+G,SAAQtF,aAEOA","file":"pt-PT.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"vue\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"iview/locale\", [\"vue\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"iview/locale\"] = factory(require(\"vue\"));\n\telse\n\t\troot[\"iview/locale\"] = factory(root[\"Vue\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/locale/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 23);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9917dc3397fa2a2ff2ba","// using with vue-i18n in CDN\r\n/*eslint-disable */\r\nimport Vue from 'vue';\r\nconst isServer = Vue.prototype.$isServer;\r\n\r\nexport default function (lang) {\r\n if (!isServer) {\r\n if (typeof window.iview !== 'undefined') {\r\n if (!('langs' in iview)) {\r\n iview.langs = {};\r\n }\r\n iview.langs[lang.i.locale] = lang;\r\n }\r\n }\r\n};\r\n/*eslint-enable */\n\n\n// WEBPACK FOOTER //\n// ./src/locale/lang.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//\n// WEBPACK FOOTER\n// external {\"root\":\"Vue\",\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"amd\":\"vue\"}\n// module id = 1\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30","import setLang from '../lang';\r\n\r\nconst lang = {\r\n i: {\r\n locale: 'pt-PT',\r\n select: {\r\n placeholder: 'Selecionar',\r\n noMatch: 'Não encontrado',\r\n loading: 'A carregar'\r\n },\r\n table: {\r\n noDataText: 'Sem dados',\r\n noFilteredDataText: 'Sem dados filtrados',\r\n confirmFilter: 'Confirmar',\r\n resetFilter: 'Limpar',\r\n clearFilter: 'Todos'\r\n },\r\n datepicker: {\r\n selectDate: 'Selecione a data',\r\n selectTime: 'Selecione a hora',\r\n startTime: 'Hora inicial',\r\n endTime: 'Hora final',\r\n clear: 'Limpar',\r\n ok: 'Confirmar',\r\n datePanelLabel: '[mmmm] de [yyyy]',\r\n month: 'Mês',\r\n month1: 'Janeiro',\r\n month2: 'Fevereiro',\r\n month3: 'Março',\r\n month4: 'Abril',\r\n month5: 'Maio',\r\n month6: 'Junho',\r\n month7: 'Julho',\r\n month8: 'Agosto',\r\n month9: 'Setembro',\r\n month10: 'Outubro',\r\n month11: 'Novembro',\r\n month12: 'Dezembro',\r\n year: 'Ano',\r\n weekStartDay: '1',\r\n weeks: {\r\n sun: 'Dom',\r\n mon: 'Seg',\r\n tue: 'Ter',\r\n wed: 'Qua',\r\n thu: 'Qui',\r\n fri: 'Sex',\r\n sat: 'Sáb'\r\n },\r\n months: {\r\n m1: 'Jan',\r\n m2: 'Fev',\r\n m3: 'Mar',\r\n m4: 'Abr',\r\n m5: 'Mai',\r\n m6: 'Jun',\r\n m7: 'Jul',\r\n m8: 'Ago',\r\n m9: 'Set',\r\n m10: 'Out',\r\n m11: 'Nov',\r\n m12: 'Dez'\r\n }\r\n },\r\n transfer: {\r\n titles: {\r\n source: 'Origem',\r\n target: 'Destino'\r\n },\r\n filterPlaceholder: 'Pesquise aqui',\r\n notFoundText: 'Não encontrado'\r\n },\r\n modal: {\r\n okText: 'Confirmar',\r\n cancelText: 'Cancelar'\r\n },\r\n poptip: {\r\n okText: 'Confirmar',\r\n cancelText: 'Cancelar'\r\n },\r\n page: {\r\n prev: 'Página anterior',\r\n next: 'Próxima página',\r\n total: 'Total',\r\n item: 'item',\r\n items: 'itens',\r\n prev5: 'Voltar 5 páginas',\r\n next5: 'Avançar 5 páginas',\r\n page: '/page',\r\n goto: 'Ir para',\r\n p: ''\r\n },\r\n rate: {\r\n star: 'Estrela',\r\n stars: 'Estrelas'\r\n },\r\n tree: {\r\n emptyText: 'Sem dados'\r\n }\r\n }\r\n};\r\n\r\nsetLang(lang);\r\n\r\nexport default lang;\n\n\n// WEBPACK FOOTER //\n// ./src/locale/lang/pt-PT.js"],"sourceRoot":""}

你期待的结果是什么?实际看到的错误信息又是什么?

不再出现这个错误提示

webpack-internal:///263:175 [HMR] bundle has 31 warnings

client.js?7955:176 ./node_modules/cargo-ant/dist/locale/ar-EG.js.map...

vue中warning_使用vue的i18n 出现很多warning提示相关推荐

  1. vue 中indexof_大厂Vue最佳实践总结,提高竞争力!

    随着这几年前端技术的快速发展,Vue框架在国内普及率极高,人人都会用.那么,如何才能写得比别人优雅?比别人漂亮? 鉴于一线互联网大厂在前沿技术领域的持续研究和大规模投入,直接向他们取经,是最便捷也是最 ...

  2. ie浏览器查看vue中js_浅析 Vue.js 中那些空间换时间的操作

    Hello,各位小伙伴,接下来的一段时间里,我会把我的课程<Vue.js 3.0 核心源码解析>中问题的答案陆续在我的公众号发布,由于课程的问题大多数都是开放性的问题,所以我的答案也不一定 ...

  3. vue中自定义指令Vue.directive(指令名, 对象)

    1.自定义全局指令 可以在不同的组件实例中使用, 也就是说在全局任意位置都可以使用Vue.directive(指令名, 对象); // 对象中定义了 该指令的所有生命周期函数方法,也叫钩子函数Vue. ...

  4. Vue中使用配置文件vue.config.js简化文件夹路径

    一.首先创建vue.config.js(名字不能更改) 二.使用vue.config.js为常用的文件路径进行标识 module.exports = {configureWebpack: {resol ...

  5. vue中v-for写在template上,加key提示错误

    v-for写在非template上,添加:key没有任何问题,但是写在template上就不行了,加了就报错. '<template>' cannot be keyed. Place th ...

  6. 怎么将vue模板转换为html,vue中自定义html文件的模板

    如果默认生成的 HTML 文件不适合需求,可以创建/使用自定义模板. 一是通过 inject 选项,然后传递给定制的 HTML 文件.html-webpack-plugin 将会自动注入所有需要的 C ...

  7. 快速入门在Vue中使用滑动插件Swiper

    前言 swiper 开源.免费.强大的滑动插件. swiper中文网 https://www.swiper.com.cn/ Swiper4中文API https://www.swiper.com.cn ...

  8. 实现 VUE 中 MVVM - step10 - Computed

    看这篇之前,如果没有看过之前的文章,移步查看: 实现 VUE 中 MVVM - step1 - defineProperty 实现 VUE 中 MVVM - step2 - Dep 实现 VUE 中 ...

  9. vue中Axios网络请求之Vue知识点归纳(十)

    本文描述 vue 中 Axios 简述 vue 中使用 Axios 发起 get 请求 vue 中使用 Axios 发起 post 请求 1 简述 Axios是一个基于Promise(ES6中用于处理 ...

最新文章

  1. 聊聊kafka client chunkQueue 与 MaxLag值
  2. ARM 之十二 Cortex-M 内核异常处理、异常定位方法、在线调试、Keil MDK-ARM 的使用
  3. 向预训练进一步:掩码式非自回归模型训练
  4. Java并发包--阻塞队列(BlockingQueue)
  5. MySQL之性能优化解说
  6. 20159206《网络攻防实践》第四周学习总结
  7. NuGet社区使用体验调查
  8. 如何用python创建文件_如何使用Python创建新的文本文件
  9. Git初学札记(五)————Branch分支管理
  10. Ubuntu 星际译王StarDict
  11. Windows系统中通过命令查看文件的MD5,SHA1,SHA256校验值
  12. Android的Animator动画(平移,渐隐,旋转,缩放)
  13. vim怎么配置只有打开特定文件高亮_vimrc里各种配置的含义
  14. hdu1426 Sudoku Killer
  15. 基于MATLAB的无线视频传输
  16. 微信小程序05 事件绑定与事件传参
  17. ST Visual Programmer(STVP)给STM8系列芯片烧录程序方法
  18. [电影]《指环王》新老三部曲完全赏析(五军之战)
  19. 牛客-二叉树层序遍历
  20. 反编译小程序.wxapkg文件

热门文章

  1. php1.6t发动机机油选择,1.6t用什么机油选择啊!?
  2. #神仙见了会流泪之#getElementsByTagName的用法
  3. 离散信道容量迭代算法
  4. UML图之类图,对象图和包图
  5. 微信小程序Canvas卡顿优化解决方法
  6. jQuery按钮切页样式
  7. 几大实时同步工具比较
  8. UMLChina建模竞赛题大全-题目全文+分卷自测(10套100题)
  9. 自建视频流媒体服务器需要满足哪些条件?
  10. gitblit中忘记admin密码,怎么办?附详细解决方法和截图