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

Regression: Could not find a declaration file for module 'qunit-dom' on v1.6.0-beta.1 #856

Closed
johanrd opened this issue Oct 27, 2020 · 11 comments · Fixed by #857
Closed

Comments

@johanrd
Copy link

johanrd commented Oct 27, 2020

  1. Clone this repo: https://github.com/johanrd/qunit-dom-typescript-reproduction
  2. Run tsc, and experience the following typescript errors:
machine:qunit-dom-typescript-reproduction user$ tsc
tests/acceptance/application-test.ts:13:12 - error TS2339: Property 'dom' does not exist on type 'Assert'.

13     assert.dom('#ember-welcome-page-id-selector').exists();
              ~~~

tests/test-helper.ts:5:23 - error TS7016: Could not find a declaration file for module 'qunit-dom'. '…/qunit-dom-typescript-reproduction/node_modules/qunit-dom/index.js' implicitly has an 'any' type.
  Try `npm install @types/qunit-dom` if it exists or add a new declaration (.d.ts) file containing `declare module 'qunit-dom';`

5 import { setup } from 'qunit-dom';

yarn add @types/qunit-dom does not make any difference (as expected from deprecation).

Have I missed something from the migration guide and/or readme? Or is it an actual regression on v1.6.0-beta.1?
thanks!

@Turbo87
Copy link
Collaborator

Turbo87 commented Oct 27, 2020

@rwjblue @scalvert could one of you have a look at ⬆️ ? 🙏

thanks for the feedback @johanrd! this does indeed look like a regression to me.

@rwjblue
Copy link
Contributor

rwjblue commented Oct 27, 2020

Yep. Will review, thank you for the reproduction!!

@scalvert
Copy link
Collaborator

Will also take a peek.

@scalvert
Copy link
Collaborator

scalvert commented Oct 27, 2020

Removing my local dist directory and rebuilding with 1.6.0-beta.1 does appear to build without a qunit-dom.d.ts. This is likely due to the name munging that we've done to support the old and new versions.

@scalvert
Copy link
Collaborator

@johanrd I tested this fix in your provided reproduction and it builds fine. Thanks for the helpful repro!

@johanrd
Copy link
Author

johanrd commented Oct 28, 2020

@scalvert Thanks for looking into this! – I ran a test now from you PR, and I actually still get the same errors:/?

See updated repo for reproduction.

@scalvert
Copy link
Collaborator

Hey @johanrd,

How are you testing the changes?

@johanrd
Copy link
Author

johanrd commented Oct 28, 2020

On https://github.com/johanrd/qunit-dom-typescript-reproduction:

$ yarn remove qunit-dom
$ yarn cache clean qunit-dom
$ rm -rf node_modules && rm yarn.lock
$ yarn install
$ yarn add https://github.com/simplabs/qunit-dom#e654d0e1c10fdb2b96f0255775ad66a2c0b24193 --dev
$ tsc

tests/acceptance/application-test.ts:13:12 - error TS2339: Property 'dom' does not exist on type 'Assert'.

13     assert.dom('#ember-welcome-page-id-selector').exists();
              ~~~

tests/test-helper.ts:5:23 - error TS7016: Could not find a declaration file for module 'qunit-dom'. '/Users/johanroed/rendra/qunit-dom-typescript-reproduction/node_modules/qunit-dom/index.js' implicitly has an 'any' type.
  Try `npm install @types/qunit-dom` if it exists or add a new declaration (.d.ts) file containing `declare module 'qunit-dom';`

5 import { setup } from 'qunit-dom';
                        ~~~~~~~~~~~


Found 2 errors.

See commit 7ae45ad
FWIW: VS Code outputs the same errors as tsc

@scalvert
Copy link
Collaborator

OK, that's not going to be sufficient to test this, as qunit-dom is built and rolled up before it's published. Try this:

  • cd qunit-dom-typescript-reproduction
  • yarn add https://github.com/simplabs/qunit-dom#e654d0e1c10fdb2b96f0255775ad66a2c0b24193 --dev
  • cd node_modules/qunit-dom (this will install qunit-dom's dependencies and build/rollup the package
  • cd ../.. && yarn build (running yarn build is more appropriate than running tsc since it runs Ember's build, which in turn will compile typescript)

@johanrd
Copy link
Author

johanrd commented Oct 28, 2020

Ah, ok, thanks – I can verify that it works after running yarn inside node_modules/qunit-dom 👌

@scalvert
Copy link
Collaborator

Awesome. Thanks for testing this out!

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.

4 participants