Closed tangtrongnghia closed 1 year ago
This is caused by the optional catch binding (omitting catch bindings in a try...catch
clause) syntax not being supported by the loader. If you use babel-loader, it should be fixed by this plugin: @babel/plugin-transform-optional-catch-binding
not working
devDependencies
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/plugin-transform-optional-catch-binding": "^7.22.5",
"@babel/polyfill": "^7.2.5",
"babel-eslint": "^10.0.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-es2015-constants": "^6.1.4",
.babelrc
{
"presets": [],
"plugins": [
"@babel/plugin-transform-optional-catch-binding",
"transform-es2015-constants",
"syntax-dynamic-import",
"@babel/plugin-proposal-optional-chaining"
]
}
Interesting, is it still the same error? May it be caused by some sorts of conflicts between the plugins? Could you try to narrow it down by disabling some of the plugins or starting with a simple default configuration? If you can provide a minimal repro that would be helpful so I can help track down this problem.
:tada: This issue has been resolved in version 5.3.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
code: import { QrcodeStream } from 'vue-qrcode-reader'
build error: ERROR in ./node_modules/vue-qrcode-reader/dist/vue-qrcode-reader.js Module parse failed: Unexpected token (67:10) You may need an appropriate loader to handle this file type. | try { | return n instanceof HTMLImageElement; | } catch { | return !1; | } @ ./node_modules/babel-loader/lib?{"cacheDirectory":true,"presets":[["@babel/preset-env",{"modules":false,"targets":{"browsers":["> 2%"]},"forceAllTransforms":true}]],"plugins":["@babel/plugin-proposal-object-rest-spread",["@babel/plugin-transform-runtime",{"helpers":false}],"transform-es2015-constants","syntax-dynamic-import","@babel/plugin-proposal-optional-chaining"]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./resources/js/components/common/QrCodeScanner.vue 21:0-49