[BUG]: Angular 9 doesn't work correctly with NGXS decorators with UMD
See original GitHub issue🐞 bug report
Affected Package
Is this a regression?
Yes
Description
https://stackblitz.com/edit/angular-9-ngxs?file=src/app/store/todo/todo.state.ts
@Persistence([
{
path: 'todos',
existingEngine: localStorage
}
])
@StateRepository()
@State<TodoStateModel>({
name: 'todos',
defaults: {
todos: [],
loaded: false,
selectedTodo: null
}
})
@Injectable()
export class TodoState
extends NgxsDataRepository<TodoStateModel> {
@Selector()
public static todos(state: TodoStateModel) {
return state.todos;
}
constructor(private readonly api: TodoApiService) {
super()
}
}
NGXS validates decorators through a handle. But now this does not work with Angular 9. However, if you build the application locally on the machine, everything works. Doesn’t work only on stackblitz, is that because it uses CommonJS?
🔬 Minimal Reproduction
https://stackblitz.com/edit/angular-9-ngxs?file=src/app/store/todo/todo.state.ts
🔥 Exception or Error
Error in /turbo_modules/@ngxs/store@3.6.2/__ivy_ngcc__/bundles/ngxs-store.umd.js (4626:23)
Selectors only work on methods
🌍 Your Environment
Angular Version:
Angular 9.1.7
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
NGXS doesn't work when update to Angular 9 with Ivy enabled
You aren't using the action in the action stream ( _actions$ ) correctly. Try changing ofActionSuccessful(this.addItem(plan)),. to
Read more >ngxs - Bountysource
Ngxs router state is out of sync with Angular router state when route resolvers are running. Minimal Reproduction. I have created a stackblitz...
Read more >Error Handling - NGXS
Handling errors after dispatching an action ... If an unhandled exception is thrown inside an action, the error will be propagated to the...
Read more >Open Source Used In MSX Managed Device Service Pack 4.0.0
This document contains licenses and notices for open source software used in this product.
Read more >ngRx/Store and 5 silly mistakes - ITNEXT
If you work with Angular you definitely know about the most popular ... can spend hours on debugging if something doesn't work as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It appears from talking to their team that this is actually a small bug in StackBlitz. apai4 is going to put a fix together! I am closing this here as it is not an issue with the Angular Framework.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.