Within my Vue + TypeScript application, I've incorporated an external package called @moj/pagination-layout
. This package utilizes the nullish operator internally. However, when attempting to run the build process, it encounters a failure and presents the following error:
ERROR Failed to compile with 1 error 1:10:16 PM
error in ./node_modules/bootstrap-vue/src/components/table/helpers/mixin-sorting.js
Module parse failed: Unexpected token (245:53)
You may need an appropriate loader to handle this file type, as currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| const sortable = field.sortable
> const sortKey = !localSorting ? field.sortKey ?? key : key
|
| // Assemble the aria-sort attribute value
@ ./node_modules/bootstrap-vue/src/components/table/table.js 19:0-77 42:7-19 76:4-16
@ ./node_modules/bootstrap-vue/src/index.js
@ ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib??ref--13-1!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/@moj/pagination-layout/src/components/PaginationLayout.vue?vue&type=script&lang=js&
package.json
{
"name": "dashboard",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"watch": "vue-cli-service build --watch"
},
// Remaining contents of package.json are omitted for brevity