Cannot use the decorators and decorators-legacy plugin together

buremba
0
buremba
commented 3 months ago

I updated the Babel plugins in nuxt.config.js as follows:

/*
  ** Build configuration
  */
  build: {
    plugins: plugins,
    babel: {
      plugins: ['transform-decorators-legacy', 'transform-class-properties']
    },

However, when I run the nuxt command I see the following exception:

Module build failed (from ./node_modules/babel-loader/lib/index.js):                                                                                                                                           friendly-errors 20:29:13
Error: Cannot use the decorators and decorators-legacy plugin together
    at validatePlugins (/Users/buremba/Code/rakam-bi/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:10897:13)
    at getParser (/Users/buremba/Code/rakam-bi/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:10962:5)
    at parse (/Users/buremba/Code/rakam-bi/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js:10946:12)

For the record, here are the Babel plugins installed when I use the debugger to see the plugin values:

["decorators","jsx","jsx","dynamicImport","decorators-legacy","classProperties","classPrivateProperties","asyncGenerators","objectRestSpread","jsonStrings","optionalCatchBinding"]
0
Informations
Question โ€ข Unresolved
#c13 - Created 3 months ago