[BUG] Routes with data enum throw error
See original GitHub issueOverview of the issue
Having a route with a data element that contains an enum throws an error:
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ErrorComponent } from './error.component';
import { ErrorPage } from './error.interfaces';
const routes: Routes = [
{
path: '404',
component: ErrorComponent,
data: {
errorType: ErrorPage.PageNotFound, // <--- This throws the error
}
},
];
@NgModule({
imports: [
RouterModule.forChild(routes)
],
exports: [
RouterModule
]
})
export class ErrorRoutingModule {
}
Error:
[14:29:43] Analysing routes definitions and clean them if necessary Unhandled Rejection at: Promise { <rejected> InvalidOperationError: Expected to find an initializer.
Operating System, Node.js, npm, compodoc version(s)
OS: macOS 11.1 Node: v15.6.0 NPM: 7.4.0 compodoc: 1.1.11
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Enum.values() not working in GWT throws compilation error
Got it fixed by adding the Enum class package under source path="" in gwt.xml. <source path='myapplication/enums/'/>.
Read more >Error handling - Apollo GraphQL Docs
For example, it throws a GRAPHQL_VALIDATION_FAILED error whenever an incoming operation isn't valid against the server's schema. Your resolvers can also throw ......
Read more >Unreasonable warning for enum-based switch statements
TYPE_PARAMETER gets added, then a processor may choose to clean up and then do nothing, or it may choose to throw an exception....
Read more >CWE-209: Generation of Error Message Containing Sensitive ...
The software generates an error message that includes sensitive information about its environment, users, or associated data. + Extended Description. The ...
Read more >Best Practices for Node.js Error-handling - Toptal
Programmer errors represent unexpected bugs in poorly written code. They mean the code itself has some issues to solve and was coded wrong....
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
The issue also happening, if you use enum as a string for the path.
I am on 1.1.14 now, shows error in console:
Storybook is working anyway. Before the build stopped.