Skip to content
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 · Fixed by #992

Comments

@YardGnomeNinja
Copy link

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
Copy link

I'm also seeing this problem

@3cp
Copy link
Member

3cp commented Nov 30, 2018

The error is from

Bluebird.config(...)

Looks like some bluebird typing messed up.

@mobilemancer
Copy link
Member

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

@jeremy-holt
Copy link

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";

@3cp
Copy link
Member

3cp 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
Copy link

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
Copy link

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

@3cp
Copy link
Member

3cp 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
Copy link

Sure

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

Successfully merging a pull request may close this issue.

5 participants