Full Stack Developer Blog
Just The Programming Blog
Resolving ‘Error TS1219’ in Angular Build: Handling Experimental Decorators in Visual Studio 2022
A few weeks back, I encountered a build issue accompanied by the following error:
As you can see it happened due to the @Injectable() decorator:
It took half a day to resolve the issue 🤪. And you need just to configure your csproj file by adding the next section :
Hope it was helpful to you.
My Artifacts are:
- Visual Studio 2022
- Angular Project based on Console Application(template)
- Angular version 13.1.1
- tsconfig.json, the experimentalDecorators set true
Leave a Comment Cancel reply
Save my name, email, and website in this browser for the next time I comment.
Navigation Menu
Search code, repositories, users, issues, pull requests..., provide feedback.
We read every piece of feedback, and take your input very seriously.
Saved searches
Use saved searches to filter your results more quickly.
To see all available qualifiers, see our documentation .
- Notifications You must be signed in to change notification settings
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
Support for "experimentalDecorators: false" in TypeScript configuration file #56146
jordimarimon commented May 29, 2024 • edited Loading
Jordimarimon commented may 29, 2024.
Sorry, something went wrong.
angular-automatic-lock-bot bot commented Jun 29, 2024
No branches or pull requests
- Career Model
- Proactive Mentorship
- Productivity
- Review Model
- Work:Life Balance
- 3D Printing
- Announcements
- Conferences
Solution to Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
With this code:
I kept getting this VS Code error:
Experimental support for decorators is a feature that is subject to change in a future release. Set the ‘experimentalDecorators’ option to remove this warning.
Even though I have experimentalDecorators set to true in my tsconfig
Turns out I had the parent folder open in VS Code,
\code\project\
But I needed to have the actual project as my root in VS Code
\code\project\app
For this error to go away.
I tried copying the tsconfig into the root folder, but that didn’t help.
So, If you want this error to go away, then make sure you have that setting set to true in your tsconfig and also make sure you have the app open at the right level.
IMAGES
VIDEO