enso-ui/strings

Module parse failed: Unexpected token (1:40)

robbykrlos opened this issue · 2 comments

This is a bug.

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
    (enso is made of many specialized packages: https://github.com/laravel-enso)
  • Did you check the documentation?
  • Did you perform a cursory search?

Description

We get the following error on yarn build since Enso 4.8.1.

\  Building for production...

 ERROR  Failed to compile with 1 error                                                                        4:14:05 PM

 error  in ./node_modules/@enso-ui/strings/src/strings.js

Module parse failed: Unexpected token (1:40)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> const diff = (first, second) => (first ?? '').split('')
|     .filter((char, index) => char !== (second ?? '').charAt(index))
|     .join('');

 @ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/@enso-ui/filters/src/renderless/CoreDateFilter.vue?vue&type=script&lang=js& 4:0-43 94:13-20
 @ ./node_modules/@enso-ui/filters/src/renderless/CoreDateFilter.vue?vue&type=script&lang=js&
 @ ./node_modules/@enso-ui/filters/src/renderless/CoreDateFilter.vue
 @ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/@enso-ui/filters/src/bulma/DateFilter.vue?vue&type=script&lang=js&
 @ ./node_modules/@enso-ui/filters/src/bulma/DateFilter.vue?vue&type=script&lang=js&
 @ ./node_modules/@enso-ui/filters/src/bulma/DateFilter.vue
 @ ./node_modules/@enso-ui/filters/bulma/index.js
 @ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/@enso-ui/activity-log/src/bulma/pages/activityLog/components/Filters.vue?vue&type=script&lang=js&
 @ ./node_modules/@enso-ui/activity-log/src/bulma/pages/activityLog/components/Filters.vue?vue&type=script&lang=js&
 @ ./node_modules/@enso-ui/activity-log/src/bulma/pages/activityLog/components/Filters.vue
 @ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/@enso-ui/activity-log/src/bulma/pages/activityLog/Index.vue?vue&type=script&lang=js&
 @ ./node_modules/@enso-ui/activity-log/src/bulma/pages/activityLog/Index.vue?vue&type=script&lang=js&
 @ ./node_modules/@enso-ui/activity-log/src/bulma/pages/activityLog/Index.vue
 @ ./node_modules/@enso-ui/activity-log/src/bulma/routes/activityLog.js
 @ ./node_modules/@enso-ui sync src\/bulma\/routes\/\w+\.js$
 @ ./node_modules/@enso-ui/ui/src/core/services/contexts.js
 @ ./node_modules/@enso-ui/ui/src/core/services/resources.js
 @ ./node_modules/@enso-ui/ui/src/core/services/store.js
 @ ./src/js/enso.js
 @ multi ./src/js/enso.js

 ERROR  Build failed with errors.
error Command failed with exit code 1.

Do you have any ideas?

I ended up checking your laravel-enso/enso client/package.json to see if we have the same dependencies(and versions). Also checking if other UI configurations are the same.

@robbykrlos, please add in your vue.config.js file the following:

module.exports = {
    transpileDependencies: ['@enso-ui/strings'],
    ......

Well, that saved me some more overtime hours...

I was just trying to see if you missed some explicit plugins (like '@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining') in @enso-ui\strings\package.json

Thanks @aocneanu, much appreciated. Learning new things every day :-)

Can I / should I do a PR on laravel-enso/enso vue.config.js then?