Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Types" import dependency error from v4.21.0 to v5.0.0 #5993

Closed
SamyakManandhar opened this issue Jan 27, 2025 · 7 comments
Closed

"Types" import dependency error from v4.21.0 to v5.0.0 #5993

SamyakManandhar opened this issue Jan 27, 2025 · 7 comments
Assignees

Comments

@SamyakManandhar
Copy link

Describe the bug
A clear and concise description of what the bug is.

I am upgrading an Angular project from 17 to 18. It was already using Formio, which was configured with @formio/angular v7.0.0 and formiojs v4.21.0. I have upgraded the project to 18 and updated @formio/angular to v8.0.0 and also installed @formio/js v5.0.0. However, when I am updating the import statements to the new namespace, I am unable to find these imports:
import { ExtendedComponentSchema (looks like moved to @formio/angular) , BuilderInfo, ValidateOptions } from '@formio/js';
On investigation, these were part of the formiojs until v5.0.0-m.3, under the types->components->schema.d.ts, but they do not seem to be present in the new @formio/js namspace v5.0.0. I have also tried deleting the formiojs, but does not seem to change anything, currently getting lot of node_module issues, possibly due to this, hence I want to understand it further, as I am not able to build the app currently.

Could I kindly suggest which package/version or approach to use to overcome this please?

Version/Branch
What release version or branch are you experiencing the behavior
v5.0.0

Expected behavior
Replacing the formiojs namespace with the new namespace @formio/js, to resolve all import dependencies.

Screenshots
If applicable, add screenshots to help explain your problem.

Image Image Image
@FrozeenHub
Copy link

Same situation here.

@FrozeenHub
Copy link

formio/angular#1122

This guy is also facing the same problem.

@brendanbond
Copy link
Contributor

We've gotten rid of some "extra" types that were in the js repository, those are now in @formio/deprecated-types - however, the errors that you've posted have to do with the type aliasing in @formio/core. We use aliases for imports, but those should be resolved by tsc-alias and perhaps it's not working as we expect. Thanks for flagging this.

However, I'm not seeing any errors related to those deprecated types in what you've shared - can you give us some steps to reproduce so we can see them on our end?

@mail4taz
Copy link

Not sure about @FrozeenHub but on my end I only have these 2 related to 'deprecated-types'

  • Error: node_modules/@formio/angular/core.d.ts:14:71 - error TS2307: Cannot find module '@formio/deprecated-types' or its corresponding type declarations.
    14 export { ComponentSchema, ExtendedComponentSchema, ElementInfo } from '@formio/deprecated-types';

  • Error: node_modules/@formio/angular/formio.common.d.ts:1:58 - error TS2307: Cannot find module '@formio/deprecated-types' or its corresponding type declarations.
    1 import { ExtendedComponentSchema, ValidateOptions } from '@formio/deprecated-types';

Image

@FrozeenHub
Copy link

On my side i haven't gotten any error on deprecated-types since i've used npm install @formio/[email protected], but i still have hundreds of errors like these:


node_modules/@formio/core/lib/error/ProcessorError.d.ts:1:33:
      1 │ import { ProcessorContext } from 'types';
        ╵                                  ~~~~~~~


X [ERROR] TS2307: Cannot find module 'utils' or its corresponding type declarations. [plugin angular-compiler]

    node_modules/@formio/core/lib/modules/jsonlogic/index.d.ts:1:48:
      1 │ import { BaseEvaluator, EvaluatorOptions } from 'utils';
        ╵                                                 ~~~~~~~


X [ERROR] TS2307: Cannot find module 'types' or its corresponding type declarations. [plugin angular-compiler]

    node_modules/@formio/core/lib/process/calculation/index.d.ts:1:98:
      1 │ ...CalculationScope, CalculationContext, ProcessorInfo } from 'types';
        ╵                                                               ~~~~~~~


X [ERROR] TS2307: Cannot find module 'types' or its corresponding type declarations. [plugin angular-compiler]

    node_modules/@formio/core/lib/process/clearHidden.d.ts:1:81:
      1 │ ...e, ProcessorContext, ProcessorInfo, ProcessorFnSync } from 'types';
        ╵                                                               ~~~~~~~


X [ERROR] TS2307: Cannot find module 'types' or its corresponding type declarations. [plugin angular-compiler]

    node_modules/@formio/core/lib/process/conditions/index.d.ts:1:96:
      1 │ ..., ConditionsScope, ProcessorInfo, ConditionsContext } from 'types';
        ╵                                                               ~~~~~~~


X [ERROR] TS2307: Cannot find module 'types' or its corresponding type declarations. [plugin angular-compiler]

    node_modules/@formio/core/lib/process/defaultValue/index.d.ts:1:98:
      1 │ ...ConditionsScope, ProcessorInfo, DefaultValueContext } from 'types';
        ╵                                                               ~~~~~~~


X [ERROR] TS2307: Cannot find module 'types' or its corresponding type declarations. [plugin angular-compiler]

    node_modules/@formio/core/lib/process/dereference/index.d.ts:1:88:
      1 │ ...orScope, ProcessorContext, ProcessorInfo, Component } from 'types';
        ╵                                                               ~~~~~~~

@travist
Copy link
Member

travist commented Feb 11, 2025

We are aware of this issue with "core" as seen @ #5715.

We have created a ticket and should be prioritizing it very soon.

@lane-formio
Copy link
Contributor

Should be fixed with formio/core#221

@formio formio deleted a comment from lane-formio Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants