Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

ember s fails on the default addon's setup after generating a Glimmer component #211

Closed
tleperou opened this issue Sep 14, 2019 · 5 comments

Comments

@tleperou
Copy link

ember -v

ember-cli: 3.13.0-beta.1
node: 10.16.3
os: linux x64

./node_modules/.bin/tsc -v

Version 3.6.3

tconfig.json and tslint.json or eslint.json

My tsconfig.json

{
"compilerOptions": {
"target": "es2017",
"allowJs": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"noImplicitThis": true,
"alwaysStrict": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noEmitOnError": false,
"noEmit": true,
"inlineSourceMap": true,
"inlineSources": true,
"baseUrl": ".",
"module": "es6",
"experimentalDecorators": true,
"paths": {
"dummy/tests/": [
"tests/
"
],
"dummy/": [
"tests/dummy/app/
",
"app/"
],
"typescript-test-addon": [
"addon"
],
"typescript-test-addon/
": [
"addon/"
],
"typescript-test-addon/test-support": [
"addon-test-support"
],
"typescript-test-addon/test-support/
": [
"addon-test-support/"
],
"
": [
"types/"
]
}
},
"include": [
"app/**/
",
"addon//*",
"tests/
/",
"types/**/
",
"test-support//*",
"addon-test-support/
/*"
]
}

What are instructions we can follow to reproduce the issue?

ember addon my-addon -b @ember/octane-addon-blueprint
cd my-addon
ember install ember-cli-typescript@latest --save
ember g my-component
ember s

Now about that bug. What did you expect to see?

I expect to start properly Ember, bug/errors free.

What happened instead?

Ember returns the following:

node_modules/@glimmer/interfaces/dist/types/lib/dom/bounds.d.ts:1:43 - error TS2307: Cannot find module '@simple-dom/interface'.

1 import { SimpleElement, SimpleNode } from '@simple-dom/interface';
                                            ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/vm/update.d.ts:4:28 - error TS2307: Cannot find module '@simple-dom/interface'.

4 import { SimpleNode } from '@simple-dom/interface';
                             ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/vm/update.d.ts:46:29 - error TS2307: Cannot find module '@simple-dom/interface'.

46     parentElement(): import("@simple-dom/interface").SimpleElement;
                               ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/vm/attributes/index.d.ts:2:46 - error TS2307: Cannot find module '@simple-dom/interface'.

2 import { AttrNamespace, SimpleElement } from '@simple-dom/interface';
                                               ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/vm/attributes/dynamic.d.ts:2:46 - error TS2307: Cannot find module '@simple-dom/interface'.

2 import { AttrNamespace, SimpleElement } from '@simple-dom/interface';
                                               ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/bounds.d.ts:3:43 - error TS2307: Cannot find module '@simple-dom/interface'.

3 import { SimpleElement, SimpleNode } from '@simple-dom/interface';
                                            ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/component/curried-component.d.ts:6:87 - error TS2677: A type predicate's type must be assignable to its parameter's type.
  Type 'CurriedComponentDefinition' is not assignable to type 'Maybe<Dict<unknown>>'.
    Type 'CurriedComponentDefinition' is not assignable to type 'Dict<unknown>'.
      Index signature is missing in type 'CurriedComponentDefinition'.

6 export declare function isComponentDefinition(definition: Maybe<Dict>): definition is CurriedComponentDefinition;
                                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/dom/operations.d.ts:1:86 - error TS2307: Cannot find module '@simple-dom/interface'.

1 import { SimpleElement, SimpleDocument, SimpleNode, SimpleText, SimpleComment } from '@simple-dom/interface';
                                                                                       ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/dom/helper.d.ts:3:103 - error TS2307: Cannot find module '@simple-dom/interface'.

3 import { AttrNamespace, ElementNamespace, Namespace, SimpleDocument, SimpleElement, SimpleNode } from '@simple-dom/interface';
                                                                                                        ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/dom/props.d.ts:1:31 - error TS2307: Cannot find module '@simple-dom/interface'.

1 import { SimpleElement } from '@simple-dom/interface';
                                ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/environment.d.ts:4:62 - error TS2307: Cannot find module '@simple-dom/interface'.

4 import { AttrNamespace, SimpleDocument, SimpleElement } from '@simple-dom/interface';
                                                               ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/vm/element-builder.d.ts:3:109 - error TS2307: Cannot find module '@simple-dom/interface'.

3 import { AttrNamespace, SimpleComment, SimpleDocumentFragment, SimpleElement, SimpleNode, SimpleText } from '@simple-dom/interface';
                                                                                                              ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/runtime/dist/types/lib/vm/rehydrate-builder.d.ts:3:85 - error TS2307: Cannot find module '@simple-dom/interface'.

3 import { AttrNamespace, SimpleComment, SimpleElement, SimpleNode, SimpleText } from '@simple-dom/interface';
                                                                                      ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/interfaces/dist/types/lib/dom/changes.d.ts:7:8 - error TS2307: Cannot find module '@simple-dom/interface'.

7 } from '@simple-dom/interface';
         ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/interfaces/dist/types/lib/runtime/modifier.d.ts:6:31 - error TS2307: Cannot find module '@simple-dom/interface'.

6 import { SimpleElement } from '@simple-dom/interface';
                                ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/interfaces/dist/types/lib/runtime/environment.d.ts:3:46 - error TS2307: Cannot find module '@simple-dom/interface'.

3 import { AttrNamespace, SimpleElement } from '@simple-dom/interface';
                                               ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/interfaces/dist/types/lib/components/component-manager.d.ts:2:31 - error TS2307: Cannot find module '@simple-dom/interface'.

2 import { SimpleElement } from '@simple-dom/interface';
                                ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/interfaces/dist/types/lib/runtime/render.d.ts:1:43 - error TS2307: Cannot find module '@simple-dom/interface'.

1 import { SimpleElement, SimpleNode } from '@simple-dom/interface';
                                            ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/interfaces/dist/types/lib/dom/attributes.d.ts:8:8 - error TS2307: Cannot find module '@simple-dom/interface'.

8 } from '@simple-dom/interface';
         ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/interfaces/dist/types/lib/dom/tree-construction.d.ts:7:8 - error TS2307: Cannot find module '@simple-dom/interface'.

7 } from '@simple-dom/interface';
         ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/util/dist/types/lib/destroy.d.ts:3:69 - error TS2677: A type predicate's type must be assignable to its parameter's type.
  Type 'SymbolDestroyable' is not assignable to type 'Maybe<Dict<unknown>>'.
    Type 'SymbolDestroyable' is not assignable to type 'Dict<unknown>'.
      Index signature is missing in type 'SymbolDestroyable'.

3 export declare function isDestroyable(value: Maybe<Dict>): value is SymbolDestroyable;
                                                                      ~~~~~~~~~~~~~~~~~

node_modules/@glimmer/util/dist/types/lib/dom.d.ts:1:31 - error TS2307: Cannot find module '@simple-dom/interface'.

1 import { SimpleElement } from '@simple-dom/interface';
                                ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/util/dist/types/lib/is-serialization-first-node.d.ts:1:28 - error TS2307: Cannot find module '@simple-dom/interface'.

1 import { SimpleNode } from '@simple-dom/interface';
                             ~~~~~~~~~~~~~~~~~~~~~~~

tests/integration/components/my-component-test.ts:15:18 - error TS2531: Object is possibly 'null'.

15     assert.equal(this.element.textContent.trim(), '');
                    ~~~~~~~~~~~~~~~~~~~~~~~~

tests/integration/components/my-component-test.ts:24:18 - error TS2531: Object is possibly 'null'.

24     assert.equal(this.element.textContent.trim(), 'template block text');

What did I try?

I manually added simple-dom:

npm install simple-dom

Then, only the following remains:

node_modules/@glimmer/runtime/dist/types/lib/component/curried-component.d.ts:6:87 - error TS2677: A type predicate's type must be assignable to its parameter's type.
  Type 'CurriedComponentDefinition' is not assignable to type 'Maybe<Dict<unknown>>'.
    Type 'CurriedComponentDefinition' is not assignable to type 'Dict<unknown>'.
      Index signature is missing in type 'CurriedComponentDefinition'.

6 export declare function isComponentDefinition(definition: Maybe<Dict>): definition is CurriedComponentDefinition;
                                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@glimmer/util/dist/types/lib/destroy.d.ts:3:69 - error TS2677: A type predicate's type must be assignable to its parameter's type.
  Type 'SymbolDestroyable' is not assignable to type 'Maybe<Dict<unknown>>'.
    Type 'SymbolDestroyable' is not assignable to type 'Dict<unknown>'.
      Index signature is missing in type 'SymbolDestroyable'.

3 export declare function isDestroyable(value: Maybe<Dict>): value is SymbolDestroyable;
                                                                      ~~~~~~~~~~~~~~~~~

tests/integration/components/my-component-test.ts:15:18 - error TS2531: Object is possibly 'null'.

15     assert.equal(this.element.textContent.trim(), '');
                    ~~~~~~~~~~~~~~~~~~~~~~~~

tests/integration/components/my-component-test.ts:24:18 - error TS2531: Object is possibly 'null'.

24     assert.equal(this.element.textContent.trim(), 'template block text');
                    ~~~~~~~~~~~~~~~~~~~~~~~~

The typescript errors are a bit disturbing since it's a default setup. Did I make a mistake? Here is a GIT with it: https://github.com/tleperou/ember-addon-glimmer-debug

@tleperou tleperou changed the title ember s fails on the default addon's setup of Glimmer components ember s fails on the default addon's setup after generating a Glimmer component Sep 14, 2019
@tleperou
Copy link
Author

tleperou commented Sep 14, 2019

These errors occur using ember-cli-typescript. In the event of the issue might concern one or both packages, I posted it here too.

@chriskrycho
Copy link
Contributor

chriskrycho commented Sep 15, 2019

See my comments on that issue; this is a known issue an dill link to the existing issue tracking it later!

@chriskrycho
Copy link
Contributor

chriskrycho commented Sep 16, 2019

Upstream issue: glimmerjs/glimmer-vm#946.

@tomdale
Copy link
Contributor

tomdale commented Oct 2, 2019

Should be at least partially addressed by #214, which prevents the need to export Glimmer VM types.

@locks
Copy link
Contributor

locks commented Apr 18, 2020

Tracked at mentioned glimmer-vm issue and partially addressed by #214

@locks locks closed this as completed Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants