dojo / cli-build-webpack

🚀 **DEPRECATED** Dojo 2 - cli command for building applications
http://dojo.io
Other
4 stars 19 forks source link

Again : Any Type Error in any interface of any dependency prevents build #163

Closed sebilasse closed 7 years ago

sebilasse commented 7 years ago

also related to https://github.com/dojo/cli-build/issues/131

The problem is again with errors of types of dependencies. I had the same issue with lodash and now I eliminated that I get the errors below. While I fixed any TypeError in any of my own modules I can't fix any of the errors of any dependency.

It has absolutely no effect on the JS part, so can I ignore them somehow ?

As you can see in the end, nothing is built ... > dojo build -w :

ERROR in /Users/sebi/Desktop/redaktorTS2/src/webcomponents/semantic/node_modules/@dojo/core/async/Task.d.ts
(28,22): error TS2417: Class static side 'typeof Task' incorrectly extends base class static side 'typeof ExtensiblePromise'.
  Types of property 'race' are incompatible.
    Type '<F extends ExtensiblePromise<T>, T>(iterable: Iterable<T | Thenable<T>> | (T | Thenable<T>)[]) =>...' is not assignable to type '<F extends ExtensiblePromise<T>, T>(iterable: Iterable<T | Thenable<T>> | (T | Thenable<T>)[]) => F'.
      Type 'Task<T>' is not assignable to type 'F'.

ERROR in /Users/sebi/Desktop/redaktorTS2/src/webcomponents/semantic/node_modules/@dojo/core/encoding.d.ts
(2,61): error TS2304: Cannot find name 'Buffer'.

ERROR in /Users/sebi/Desktop/redaktorTS2/src/webcomponents/semantic/node_modules/@dojo/core/encoding.d.ts
(1,23): error TS2688: Cannot find type definition file for 'node'.

ERROR in /Users/sebi/Desktop/redaktorTS2/src/webcomponents/semantic/node_modules/@dojo/widget-core/WidgetBase.d.ts
(9,18): error TS2430: Interface 'InternalWNode' incorrectly extends interface 'WNode<DefaultWidgetBaseInterface>'.
  Types of property 'properties' are incompatible.
    Type '{ bind: any; }' has no properties in common with type 'WidgetProperties'.

ERROR in /Users/sebi/Desktop/redaktorTS2/src/webcomponents/semantic/tests/unit/App.ts
(1,32): error TS7016: Could not find a declaration file for module 'intern/lib/interfaces/object'. '/Users/sebi/Desktop/redaktorTS2/src/webcomponents/semantic/node_modules/intern/lib/interfaces/object.js' implicitly has an 'any' type.
  Try `npm install @types/intern/lib/interfaces/object` if it exists or add a new declaration (.d.ts) file containing `declare module 'intern/lib/interfaces/object';`

ERROR in ./~/@dojo/core/text.js
Module not found: Error: Can't resolve 'fs' in '/Users/sebi/Desktop/redaktorTS2/src/webcomponents/semantic/node_modules/@dojo/core'
 @ ./~/@dojo/core/text.js 34:65-78
 @ ./~/@dojo/core/main.js
 @ ./src/lib/main.ts
 @ ./src/widgets/Container/Container.ts
 @ ./src/App.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client? ./src/main.css ./src/main.ts
Child html-webpack-plugin for "index.html":
         Asset     Size  Chunks  Chunk Names
    index.html  3.04 kB       0  
webpack: Failed to compile.
sebilasse commented 7 years ago

Btw: The TypeError's should be explained by the Linter but the ERROR in ./~/@dojo/core/text.js would be fixed by adding

node: {
  fs: 'empty'
}

to the webpack.config.js

agubler commented 7 years ago

@sebilasse in this case it looks like you are using TS2.4? If so then the Dojo 2 packages have not been updated to be compatible yet.

sebilasse commented 7 years ago

@agubler But why can't build do what tsc does ? It is impossible for me to fix any TypeErrors in any dependency of any other developer (regardless of the mentioned errors). Problem : It is not building for tsc warnings. Expected: It should build what it can.

agubler commented 7 years ago

They are not warnings though, they are errors so I don't think that the project should build using cli-build-webpack.

You won't need to fix upstream dependencies once the dojo packages have been updated to support TS2.4, until then unfortunately I would recommend not using TS2.4.

sebilasse commented 7 years ago

@agubler Well, I am developing a long-term thing, so I already fixed these for 2.5 (next) which I am using because of a very cool demo decorator I did which is producing a JSON Schema, runtime validation and a form component below the widget so that you do not need to write any Schema or /example manually. Also I needed string based enums. It was easy to fix and above webpack.config insert is at least "working" ... This can be closed then, I guess.

kitsonk commented 7 years ago

Using next is very dangerous for anything that isn't just test code. We keep our versions of TypeScript pinned to minor releases because we have encountered, even in release candidates, late breaking changes that have to be addressed. We tend to very rapidly update the Dojo 2 packages when the release is official, but please do not expect us to pre-fix things. We have enough to worry about with out worrying about supporting people on unstable branches of TypeScript.

We work really closely with the team, and have usually a good idea of what changes in the version will impact us, as well as what features we will rapidly adopt into our code base. I am afraid we can only really consider dealing with issue with released versions. If you have a forward compatible PR, I am sure we would be glad to consider it, but the only version of TypeScript we support our code with is the version that the package depends upon.