GithubHelp home page GithubHelp logo

Comments (8)

GiladShoham avatar GiladShoham commented on June 25, 2024 1

Any chance you can share your workspace?
@davidfirst fyi

from bit.

GiladShoham avatar GiladShoham commented on June 25, 2024

can you try running
bit ws-config write --clean
then the check-types again

from bit.

sbland avatar sbland commented on June 25, 2024

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.

sbland avatar sbland commented on June 25, 2024

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 then bit install then bit check-types (no errors) bit snap -b I then get typescript errors in the build pipeline
  • bit snap" then bit buildI now get thetypescript error: "message": "Debug Failure." but with no context on what failed.

from bit.

sbland avatar sbland commented on June 25, 2024

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.

sbland avatar sbland commented on June 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.