Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Does not build, got errors TS1238 and TS2509 #39

Closed
sfermigier opened this issue Mar 19, 2018 · 5 comments
Closed

Does not build, got errors TS1238 and TS2509 #39

sfermigier opened this issue Mar 19, 2018 · 5 comments

Comments

@sfermigier
Copy link

➜  TypeScript-Vue-Starter git:(master) ✗ yarn
yarn install v1.5.1
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.39s.
➜  TypeScript-Vue-Starter git:(master) ✗ npm run build

> [email protected] build /Users/fermigier/git/vue/TypeScript-Vue-Starter
> webpack

ts-loader: Using [email protected] and /Users/fermigier/git/vue/TypeScript-Vue-Starter/tsconfig.json
Hash: e7974bc5938b571dfaab
Version: webpack 2.5.0
Time: 2370ms
   Asset     Size  Chunks                    Chunk Names
build.js  1.08 MB       0  [emitted]  [big]  main
   [0] ./~/vue/dist/vue.esm.js 292 kB {0} [built]
   [1] ./~/process/browser.js 5.42 kB {0} [built]
   [2] (webpack)/buildin/global.js 509 bytes {0} [built]
   [3] ./~/css-loader/lib/css-base.js 2.26 kB {0} [built]
   [4] ./~/vue-loader/lib/component-normalizer.js 2.55 kB {0} [built]
   [5] ./~/vue-style-loader/lib/addStylesClient.js 6.05 kB {0} [built]
  [10] ./~/reflect-metadata/Reflect.js 52.3 kB {0} [built]
  [11] ./~/setimmediate/setImmediate.js 6.47 kB {0} [built]
  [12] ./~/timers-browserify/main.js 1.36 kB {0} [built]
  [15] ./src/index.ts 666 bytes {0} [built]
  [16] ./~/vue-class-component/dist/vue-class-component.common.js 8.05 kB {0} [built]
  [19] ./~/vue-property-decorator/lib/vue-property-decorator.umd.js 4.85 kB {0} [built]
  [22] ./~/vue-style-loader/lib/listToStyles.js 639 bytes {0} [built]
    + 10 hidden modules

ERROR in /Users/fermigier/git/vue/TypeScript-Vue-Starter/src/components/HelloDecorator.vue.ts
(14,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
  Type '<VC extends VueClass<Vue>>(target: VC) => VC' is not assignable to type 'typeof HelloDecorator'.
    Property 'extend' is missing in type '<VC extends VueClass<Vue>>(target: VC) => VC'.

ERROR in /Users/fermigier/git/vue/TypeScript-Vue-Starter/src/components/HelloDecorator.vue.ts
(15,45): error TS2509: Base constructor return type 'CombinedVueInstance<Vue, Data, Methods, Computed, Record<PropNames, any>>' is not a class or interface type.
@vindarel
Copy link

Hello,
I have two different issues (!):

$ npm run build
ERROR in /home/vince/bacasable/TypeScript-Vue-Starter/src/components/HelloDecorator.vue.ts
(16,13): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor.

ERROR in /home/vince/bacasable/TypeScript-Vue-Starter/src/components/HelloDecorator.vue.ts
(17,13): error TS2564: Property 'initialEnthusiasm' has no initializer and is not definitely assigned in the constructor.

Debian, node v9.3, npm 5.5.

Regards

@ThePlastic
Copy link

ThePlastic commented Mar 22, 2018

@vindarel
I faced the same error updating typescript to 2.7.2
in my case, to solve it was enough to add this line

"strictPropertyInitialization": false,

to the CompilerOptions property into the tsconfig.json file

@vindarel
Copy link

that made it ! Thanks.

@DanielRosenwasser
Copy link
Member

Duplicate of #36.

@zhangenming
Copy link

zhangenming commented Dec 10, 2018

"strictPropertyInitialization": false,
didn't work with me
node v10.14.1
tsc v3.2.1
still has this problem
@DanielRosenwasser

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants