Comments (8)
Any chance you can share your workspace?
@davidfirst fyi
from bit.
can you try running
bit ws-config write --clean
then the check-types
again
from bit.
Thanks @GiladShoham I ran that and it added a few tsconfig and eslint files.
check-types
still returned no errors.
When I dug into some of the tsconfigs created i noticed that it was actually my node env compnents that were not working as expected. For background info I have 2 custom environments in my workspace.
- One for node components (which inherits
@bitdev/node.node-env
) - one for React components (which inherits
@bitdev/react.react-env
).
I noticed that tsconfig files were created in any directory that only contained the components with the custom node env. These tsconfig files appear to not be importing my custom tsconfig.
I then compared the .bit.env files for each environment and noticed in the React environment I had defined protected tsconfigPath = require.resolve('./config/tsconfig.json');
but I hadn't in the node environment.
Adding this seems to have resolved the issue but it seems odd that without this the tsconfig was different between compile and build even though both referred to this.tsconfigPath
from bit.
I now get the correct type checking in VSCode but check-types
is still not picking up on the correct tsconfig.
I've tried the following and none give me any type errors from check-types:
bit reset --all
thenbit install
thenbit check-types
(no errors)bit snap -b
I then get typescript errors in the build pipelinebit snap" then
bit buildI now get the
typescript error: "message": "Debug Failure." but with no context on what failed.
from bit.
After some more testing with a stripped back workspace I found that everything worked until I added one of my react env components that was referencing a node-env component in the types.
I.e.
import { apiEndpoint } from 'my-node-env-component`;
export const apiCall = (): ReturnType<typeof apiEndpoint> => {
...
}
Defining the type explicitly mostly fixed the problems I was having. I'm not sure why this resulted in random type error in my node-env files.
For now I think I have fixed this for my environment but I'd be happy to help if anyone has a similar issue.
from bit.
This issue cropped up again and I'm now certain it is having a component in an environment with a tsconfig with strict: true
referencing a component with a tsconfig with strict: false
. In this case check types and the IDE do not pick up on strict typing but the builder does. @GiladShoham what should happen here? Should check-types and the builder be consistent and both fail or should neither fail?
from bit.
Related Issues (20)
- I can't run express server with sqlite3 HOT 2
- Best Practice For Importing Another Bit Component to Avoid Ripple CI Failure HOT 5
- ReferenceError: jest is not defined HOT 1
- Export Error HOT 1
- Bit Installation error:- reason: self signed certificate in certificate chain HOT 3
- [WORKSPACE] How to move my package.json/ lock deps to bit workspace ? HOT 1
- [WORKSPACE] Monorepo packages/apps dependencies managements HOT 3
- [WORKSPACE] Bit status how to not be aware of some import s HOT 4
- Very slow to install bit HOT 3
- Not possible to add remote bit scope HOT 2
- [WORKSPACE] How can we install dependencies needed only HOT 8
- New workspace env not found error HOT 2
- Multiple issues when trying to tag many components HOT 2
- next/image error - React.jsx: type is invalid -- expected a string (for built-in components) or a class/function but got: object HOT 1
- Custom Vite config for Vue App HOT 1
- Where to download file bin to install ? HOT 3
- Cannot find module '../node_modules/@teambit/bit/dist/app' HOT 4
- Components marked as removed still present in remote workspace
- Deployed self hosted Docker, but access failed. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bit.