Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages appear to have untranspiled optional chaining ('?.') operator. #1069

Open
dwjohnston opened this issue Oct 17, 2021 · 2 comments
Open

Comments

@dwjohnston
Copy link
Contributor

Describe the bug

Users should be able to use the package without additional webpack/babel configuration etc.

To Reproduce
See repro here:
dwjohnston/vic-gov-data-graph-take-2@d23a212

Expected behaviour

I should be able to use the packages no problems.

Actual behaviour
I get the following error:

rtl.js:1 Uncaught Error: Module parse failed: Unexpected token (8:26)
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
|   methods: {
|     isRtl () {
>       if (this.rplOptions?.siteRtl === true) {
|         return true
|       } else {
    at eval (rtl.js:1)
    at Object../node_modules/@dpc-sdp/ripple-global/mixins/rtl.js (chunk-vendors.js:1172)
    at __webpack_require__ (app.js:854)
    at fn (app.js:151)
    at eval (cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/@dpc-sdp/ripple-document-link/DocumentLink.vue?vue&type=script&lang=js&:7)
    at Module../node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/@dpc-sdp/ripple-document-link/DocumentLink.vue?vue&type=script&lang=js& (chunk-vendors.js:3818)
    at __webpack_require__ (app.js:854)
    at fn (app.js:151)
    at eval (DocumentLink.vue?2f1f:1)
    at Module../node_modules/@dpc-sdp/ripple-document-link/DocumentLink.vue?vue&type=script&lang=js& (chunk-vendors.js:143)
@dwjohnston
Copy link
Contributor Author

Solution, when using the vue cli is to get it to transpile the dpc dependencies

dwjohnston/vic-gov-data-graph-take-2@0c60715

   //vue.config.js
    transpileDependencies: [
      "@dpc-sdp/ripple-global"
    ],

@dwjohnston
Copy link
Contributor Author

I'm also having issues with writing tests due to this. The package comes with untranspiled .vue files - which, by default most testing frameworks etc, will not attempt to transpile code in the `node_modules_ folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant