Closed danielkcz closed 4 years ago
I am trying to understand where and how is the package.json
generated. When building locally, it actually finds the correct main in dist
folder. However, the .bitmap
files have it like that...
"speedlo.hooks/use-async-effect@0.0.1": {
"files": [
{
"relativePath": "src/useAsyncEffect.ts",
"test": false,
"name": "useAsyncEffect.ts"
}
],
"mainFile": "src/useAsyncEffect.ts",
"origin": "AUTHORED",
"exported": true
},
No mention of the dist file. I tried ...
bit add -i use-async-effect -m dist/use-async-effect/useAsyncEffect.js
error: file or directory "" was not found.
run 'bit doctor' to get detailed workspace diagnosis and issue resolution.
It's really strange how is this supposed to work.
Which version of the compiler you use?
Well, yesterday it was react-typescript@3.0.13
. Today I noticed there was a 3.0.14
, but I wasn't able to get it to build. It's really strange considering the tsconfig
hasn't changed and I am not even using those types anywhere in the code.
Command failed: D:\repo\node_modules\typescript\bin\tsc -d
error TS2318: Cannot find global type 'Array'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
Error: Command failed: D:\repo\node_modules\typescript\bin\tsc -d
error TS2318: Cannot find global type 'Array'.
error TS2318: Cannot find global type 'Boolean'.
error TS2318: Cannot find global type 'Function'.
error TS2318: Cannot find global type 'IArguments'.
error TS2318: Cannot find global type 'Number'.
error TS2318: Cannot find global type 'Object'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'String'.
at makeError (D:\repo\packages\hooks\.bit\components\compilers\react-typescript\bit.envs\3.0.14\components\.dependencies\compilers\typescript\bit.envs\3.0.6\node_modules\execa\index.js:174:9)
I wonder, why does 3.0.14 depends on 3.0.6 of typescript compiler while 3.0.13 depends on 3.0.12?
Hi, I've published a new version of the compiler yesterday. This is causing most of the issues. I will look at this now.
@FredyC can you try the latest compiler version ?
@qballer Well, it builds now, but still the same issue with main
, pointing to source "ts" file.
https://bit.dev/fredyc/test/use-mount-log
my collection for testing
I think that this conversation is best continued in gitter: https://gitter.im/bit-src/Bit Would you mind coming online?
@qballer Thanks again. It's fixed with 3.0.16.
Just used the Bit for a first time to export a couple of React Hooks we have. Hooks are not exactly components, but I don't see why it shouldn't work :) Problem is that generated
package.json
hasmain
field pointing to the source.ts
file instead of the one fromdist
.https://bit.dev/speedlo/hooks/use-async-effect/~code
To properly consume such hook we would have to do the following and that's fairly ugly :)
Is it some configuration I am missing or why is that happening?