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

Build Error TS4090 when using Protractor #1090

Closed
MichaelPetrinolis opened this issue Apr 23, 2019 · 8 comments

Comments

Projects
None yet
5 participants
@MichaelPetrinolis
Copy link
Contributor

commented Apr 23, 2019

I'm submitting a bug report

  • Library Version:
    1.0.0-beta.15

  • Operating System:
    Windows [10]

  • Node Version:
    v10.15.0

  • NPM Version:
    6.4.1

  • Browser:
    Chrome 73

  • Language:
    TypeScript 3.4

  • Loader/bundler:
    Webpack

Current behavior:
au run returns
[tsl] ERROR
TS4090: Conflicting definitions for 'q' found at 'xxx/node_modules/@types/q/index.d.ts' and 'xxx/node_modules/protractor/node_modules/@types/q/index.d.ts'. Consider installing a specific version of this library to resolve the conflict.

  • What is the expected behavior?
    should compile

  • What is the motivation / use case for changing the behavior?
    the OOB experience should be succesful

if define typesRoots in tsconfig.json the problem is solved

"typeRoots": ["./node_modules/@types"]
@3cp

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

I could not reproduce this issue. But I encountered another typing issue with latest TypeScript even without protractor, just with default webpack typescript jest app.

ERROR in /Users/huocp/playground/w3/test/unit/app.spec.ts
[tsl] ERROR in /Users/huocp/playground/w3/test/unit/app.spec.ts(5,1)
      TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.
@3cp

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

typeRoots also solves the issue I saw. I will get the fix in.

3cp added a commit to 3cp/cli that referenced this issue Apr 24, 2019

@zewa666

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

Can you remove your dependency on @types/q? Protractor is going to provide it anyways

@MichaelPetrinolis

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

@zewa666 i tried to remove @types/q but it cannot be removed, it exists in the package-lock probably is a dependency. You must manualy remove the conflicting @types/xxx from protractor/node_modules in order the au build to work

@3cp

This comment has been minimized.

Copy link
Member

commented May 1, 2019

For reference, @MichaelPetrinolis noticed the issue can be reproduced with

au new testapp -u -s http2,typescript,htmlmin-max,sass,postcss-typical,karma,protractor,vscode

The conflicting @types/q is from cssnano (by selecting postcss-typical).

⋊> ~/p/testapp npm list @types/q
testapp@0.1.0 /Users/huocp/playground/testapp
├─┬ cssnano@4.1.10
│ └─┬ cssnano-preset-default@4.0.7
│   └─┬ postcss-svgo@4.0.2
│     └─┬ svgo@1.2.2
│       └─┬ coa@2.0.2
│         └── @types/q@1.5.2 
└─┬ protractor@5.4.2
  └── @types/q@0.0.32 
@Krossmaskinen

This comment has been minimized.

Copy link

commented May 6, 2019

I downloaded aurelia cli fresh today, created a project with typescript using protractor. Got the same message.

Update: Also tried adding the "typeRoots": ["./node_modules/@types"] in tsconfig.json, but it didn't help.

@MichaelPetrinolis

This comment has been minimized.

Copy link
Contributor Author

commented May 6, 2019

Aurelia Cli is still in beta 15 so the fix for protractor with cssnano is not included. What options do you use to create the new project? What error do you get?

@jmzagorski

This comment has been minimized.

Copy link

commented May 27, 2019

the commit attached this issue adding the typeRoots does not seem to fix this issue for any typescript project built with the cli.

The change to ts-loader in webpack.config.js will fix it, referenced in 36d384e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.