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
Closed

Build Error TS4090 when using Protractor #1090

MichaelPetrinolis opened this issue Apr 23, 2019 · 8 comments

Comments

@MichaelPetrinolis
Copy link
Contributor

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

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

3cp commented Apr 23, 2019

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

@zewa666
Copy link
Member

zewa666 commented Apr 24, 2019

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

@MichaelPetrinolis
Copy link
Contributor Author

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

3cp 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
[email protected] /Users/huocp/playground/testapp
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └─┬ [email protected]
│       └─┬ [email protected]
│         └── @types/[email protected] 
└─┬ [email protected]
  └── @types/[email protected] 

@Krossmaskinen
Copy link

Krossmaskinen 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
Copy link
Contributor Author

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

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants