Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Unable to use @allObservable in Typescript with react-scripts-ts #14

Open
xumix opened this issue Jul 2, 2018 · 0 comments
Open

Unable to use @allObservable in Typescript with react-scripts-ts #14

xumix opened this issue Jul 2, 2018 · 0 comments

Comments

@xumix
Copy link

xumix commented Jul 2, 2018

I'm trying to use the decorator:

import { allObservable } from "mobx-decorators"

@allObservable
export default class AppState {
  public search?: string;

  constructor() {
    this.search = null as any;
  }
}

const appState = new AppState();

I get this error in browser:
TypeError: __WEBPACK_IMPORTED_MODULE_9__core_AppState__.a is not a constructor

but build passes OK
My tsconfig:

{
  "compilerOptions": {
    "baseUrl": ".",
    "outDir": "build/dist",
    "module": "esnext",
    "target": "es5",
    "lib": [ "es6", "dom" ],
    "sourceMap": true,
    "allowJs": true,
    "jsx": "react",
    "moduleResolution": "node",
    "esModuleInterop": true,
    "rootDir": "src",
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noImplicitAny": false,
    "strictNullChecks": true,
    "suppressImplicitAnyIndexErrors": true,
    "noUnusedLocals": true,
    "skipLibCheck": true,
    "importHelpers": true,
    "experimentalDecorators": true
  },
  "exclude": [
    "node_modules",
    "build",
    "public",
    "scripts",
    "acceptance-tests",
    "webpack",
    "jest",
    "src/setupTests.ts",
    "src/semantic"
  ]
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant