You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please paste your tsconfig.json and tslint.json or eslint.json (if applicable) below
Not applicable.
What are instructions we can follow to reproduce the issue?
ember new sample
cd ./sample
ember install ember-cli-typescript
# Runs without any issue
yarn run prepack
# Add types for `qunit-dom`# https://github.com/simplabs/qunit-dom/tree/v2.0.0#typescript# Fails (see error log below)
yarn run prepack
The error log from the last command `yarn run prepack`
tests/test-helper.ts:1:25 - error TS7016: Could not find a declaration file for module 'dummy/app'. '/Users/_/Dev/emberjs/__test-addon-with-typescript/tests/dummy/app/app.js' implicitly has an 'any' type.
1 import Application from 'dummy/app';~~~~~~~~~~~
Found 1 error.
Command failed with exit code 1: tsc --allowJs false --noEmit false --rootDir /Users/_/Dev/emberjs/__test-addon-with-typescript --isolatedModules false --declaration --declarationDir /Users/_/Dev/emberjs/__test-addon-with-typescript/e-c-ts-precompile-14668 --emitDeclarationOnly --pretty true
tests/test-helper.ts:1:25 - error TS7016: Could not find a declaration file for module 'dummy/app'. '/Users/_/Dev/emberjs/__test-addon-with-typescript/tests/dummy/app/app.js' implicitly has an 'any' type.
Now about that bug. What did you expect to see?
Add-on correctly published to npmjs.
What happened instead?
⬆️ See the error log above
My current fix is to write declare module 'dummy/app'; in the file /types/dummy/index.d.ts. Do you think it is wise? Do you think of a better solution?
Then exactly same issue when creating a unit-test for an Initializer or an Instance-Initializer and renaming the file with the extension .ts, the command yarn run prepack fails at the line import { initialize } from 'dummy/instance-initializers/my-thing'.
The text was updated successfully, but these errors were encountered:
@dfreeman: Unfortunately I don't have time to write up a full response on the issue you opened right now, but the short answer is that ts:precompile sets allowJs: false when it runs @dfreeman: IMO (speaking only for myself and not any of the rest of the typed-ember folks) we shouldn't be setting allowJs: true in the default blueprint in the first place @dfreeman: but I think that's the root of your problem @dfreeman: either adding a .d.ts file alongside tests/dummy/app/app.js or actually converting that file to TS should solve your problem @dfreeman: the declare module you suggested should also be fine
Also asked on Discord:
https://discord.com/channels/480462759797063690/484421406659182603/885928438542794752
Please paste the output of
ember -v
hereember-cli: 3.24.0
node: 14.17.6
os: darwin x64
Please paste the output of
tsc -v
hereVersion 4.4.3
Please paste the version of
ember-cli-typescript
andember-cli-typescript-blueprints
herePlease paste your
tsconfig.json
andtslint.json
oreslint.json
(if applicable) belowNot applicable.
What are instructions we can follow to reproduce the issue?
The error log from the last command `yarn run prepack`
Now about that bug. What did you expect to see?
Add-on correctly published to npmjs.
What happened instead?
⬆️ See the error log above
My current fix is to write
declare module 'dummy/app';
in the file/types/dummy/index.d.ts
. Do you think it is wise? Do you think of a better solution?Then exactly same issue when creating a unit-test for an Initializer or an Instance-Initializer and renaming the file with the extension
.ts
, the commandyarn run prepack
fails at the lineimport { initialize } from 'dummy/instance-initializers/my-thing'
.The text was updated successfully, but these errors were encountered: