Typescript decorator using not possible


I’m developing a panel plugin in typescript. I want to use a typescript decorator.

I get the following error:

Module build failed (from ../node_modules/swc-loader/src/index.js):
  × Unexpected token `@`. Expected identifier, string literal, numeric literal or [ for the computed key

Even adding "experimentalDecorators": true to the tsconfig.json and/or installing the npm install @babel/plugin-proposal-decorators does not solve the situation.

Does anybody know how to solve it?

@phdehner the default configuration that comes with create-plugin might not support decorators. You’ll have to extend the configuration and add support yourself. here’s how to extend the configuration for a plugin Extend configurations | Grafana Plugin Tools

The specifics of how to add support for decorators is up to your configuration extension.

Mhm okay… Thanks