2

I'm trying to link a library between two projects to help with development workflow. Sharing some code and types between my TypeScript backend and frontend.

It seemed to work with const functions, but when I add some enums and types I get this error:

./server/presenter-common/src/events.ts 5:7
Module parse failed: Unexpected token (5:7)
File was processed with these loaders:
 * ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
You may need an additional loader to handle the result of these loaders.
| 
| 
> export enum SESSION_STATUS{
|     SCHEDULED="SCHEDULED",
|     LIVE="LIVE",

My code:

export enum SESSION_STATUS{
    SCHEDULED="SCHEDULED",
    LIVE="LIVE",
    ENDED="ENDED",
    RUNNING="RUNNING"
}

It works on my server app (TypeScript, ExpressJs).

But fails on react frontend (un-ejected create-react-app).

somerandomusername
  • 1,993
  • 4
  • 23
  • 55

0 Answers0