Closed
Description
Bug report
Upgrading to Next 9.4 breaks Typescript enum definitions.
Describe the bug
With Next 9.3.6, the following file can be included in a project with no issues:
export enum SearchEntity {
SEARCH_ENTITY_NONE = 0,
SEARCH_ENTITY_POSITION = 1,
SEARCH_ENTITY_USER = 2,
SEARCH_ENTITY_QUESTION = 3,
SEARCH_ENTITY_TOPIC = 4,
}
With 9.4.0, the following error occurs:
error - ./lib/search/search_gw.ts 1:7
Module parse failed: Unexpected token (1:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> export enum SearchEntity {
| SEARCH_ENTITY_NONE = 0,
| SEARCH_ENTITY_POSITION = 1,
I don't have any custom babel config, and I use the standard out of the box Typescript support.
I've confirmed that removing the enum from the file lets the rest of the file be compiled.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- import a file that includes
export enum
Expected behavior
The code should compile, as it did with 9.3.6.
System information
- OS: [macOS]
- Version of Next.js: [9.4.0]
- Version of Typescript: [3.8.3]
Metadata
Metadata
Assignees
Labels
No labels