New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.0-beta.6 compilation error: TS2339: Property 'config' does not exist on type 'typeof Async'. #991

Closed
YardGnomeNinja opened this Issue Nov 30, 2018 · 9 comments

Comments

Projects
None yet
5 participants
@YardGnomeNinja
Copy link

YardGnomeNinja commented Nov 30, 2018

I'm submitting a bug report

  • Library Version:
    1.0.0-beta.6

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    10.12.0

  • NPM Version:
    6.4.1

  • Browser:
    all

  • Language:
    TypeScript 3.1.6

  • Loader/bundler:
    Webpack

Current behavior:

  1. au new newproject
  2. Select: Default TypeScript
  3. Displays:
    Name: newproject
    Platform: Web
    Bundler: Webpack
    Loader: None
    Transpiler: TypeScript
    Markup Processor: Minimal Minification
    CSS Processor: None
    Unit Test Runner: Jest
    Unit Test Runner: Karma
    Integration Test Runner: None
    Editor: Visual Studio Code
  1. Select: Yes (I would like to create this project)
  2. Select: Yes (I would like to install project dependencies)
  3. au run --env dev --watch
  4. Receive compilation error:
[main] ./src/main.ts 1.09 KiB {app} [built] [1 error]
    + 64 hidden modules

ERROR in C:\src\newproject\src\main.ts
./src/main.ts
[tsl] ERROR in C:\src\newproject\src\main.ts(9,10)
      TS2339: Property 'config' does not exist on type 'typeof Async'.
Child html-webpack-plugin for "index.html":
         Asset      Size  Chunks  Chunk Names
    index.html  1.36 MiB       0
    Entrypoint undefined = index.html
    [./node_modules/html-webpack-plugin/lib/loader.js!./index.ejs] 890 bytes {0} [built]
    [./node_modules/lodash/lodash.js] 527 KiB {0} [built]
    [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
    [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 519 bytes {0} [built]
i ?wdm?: Failed to compile.
  • What is the expected behavior?
    A new project should compile with no errors. ;)

  • What is the motivation / use case for changing the behavior?
    Zero error messages gives developers happy thoughts.

@YardGnomeNinja YardGnomeNinja changed the title TS2339: Property 'config' does not exist on type 'typeof Async'. 1.0.0-beta.6 compilation error: TS2339: Property 'config' does not exist on type 'typeof Async'. Nov 30, 2018

@robinchesterman

This comment has been minimized.

Copy link

robinchesterman commented Nov 30, 2018

I'm also seeing this problem

@huochunpeng

This comment has been minimized.

Copy link
Member

huochunpeng commented Nov 30, 2018

The error is from

Bluebird.config(...)

Looks like some bluebird typing messed up.

@mobilemancer

This comment has been minimized.

Copy link
Member

mobilemancer commented Nov 30, 2018

Install the typings to fix the problem.
npm install @types/bluebird

mobilemancer added a commit to mobilemancer/cli that referenced this issue Dec 2, 2018

fix(cli): add typings for bluebird
Compiletime error for bluebird fixed by adding typings.

Fixes aurelia#991

mobilemancer added a commit to mobilemancer/cli that referenced this issue Dec 2, 2018

fix(cli): add typings for bluebird
Compiletime error for bluebird fixed by adding typings.

Fixes aurelia#991

huochunpeng added a commit to huochunpeng/cli that referenced this issue Dec 3, 2018

fix(cli): add typings for bluebird
Compiletime error for bluebird fixed by adding typings.

Fixes aurelia#991

huochunpeng added a commit to huochunpeng/cli that referenced this issue Dec 3, 2018

fix(cli): add typings for bluebird
Compiletime error for bluebird fixed by adding typings.

Fixes aurelia#991
@jeremy-holt

This comment has been minimized.

Copy link

jeremy-holt commented Dec 10, 2018

Not only do you need to yarn add @types/bluebird, but you need to change the import to

import Bluebird from "bluebird";

from import * as Bluebird from "bluebird";

@huochunpeng

This comment has been minimized.

Copy link
Member

huochunpeng commented Dec 10, 2018

@jeremy-holt the old import did not fail our testing. Are you using "esModuleInterop": true in your tsconfig.json?

@jeremy-holt

This comment has been minimized.

Copy link

jeremy-holt commented Dec 10, 2018

Yes

{
  "compileOnSave": false,
  "compilerOptions": {
    "target": "es5",
    "module": "amd",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "esModuleInterop": true,
    "moduleResolution": "node",
    "sourceRoot": "src",
    "sourceMap": true,
    "allowJs": true,
    "baseUrl": "src",
    "skipLibCheck": true,
    "lib": [
      "es2017", "dom"
    ]
  },
  "include": [
    "./src/**/*.ts",
    "./test/**/*.ts",
    "./custom_typings/**/*.d.ts", "Models/Container.cs", "Models/User.cs", "../Tests/ChartOfAccount_Service_Tests.cs"
  ],
  "atom": {
    "rewriteTsconfig": false
  }
}

@jeremy-holt

This comment has been minimized.

Copy link

jeremy-holt commented Dec 10, 2018

Also you can no longer have in your route.config activationStrategy: "replace"

@huochunpeng

This comment has been minimized.

Copy link
Member

huochunpeng commented Dec 10, 2018

cli generated skeleton by default didn't turn on esModuleInterop.
esModuleInterop is recommanded by Microsoft for babel compatibility.

@jeremy-holt would you mind to create an issue in aurelia-router on the activationStrategy+TS+ esModuleInterop? Recently the router project has been migrated from esnext+flow to TS, might be related.

@jeremy-holt

This comment has been minimized.

Copy link

jeremy-holt commented Dec 10, 2018

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment