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

[email protected] asking for react packages #143

Open
joaomsrodrigues21 opened this issue Dec 22, 2024 · 3 comments
Open

[email protected] asking for react packages #143

joaomsrodrigues21 opened this issue Dec 22, 2024 · 3 comments

Comments

@joaomsrodrigues21
Copy link

Hi,

after upgrade my angular app to @angular/[email protected] and angular-email-editor to v15.2.0 it is asking for react packages during build:

`Error: node_modules/unlayer-types/embed.d.ts:2823:38 - error TS2307: Cannot find module 'react' or its corresponding type declarations.

2823 import React, { RefObject } from 'react';`

On package-lock.json I have:
"node_modules/angular-email-editor": { "version": "15.2.0", "resolved": "https://registry.npmjs.org/angular-email-editor/-/angular-email-editor-15.2.0.tgz", "integrity": "sha512-vi3LjMgL5uNRi0A59yPf4atJSzZNfrvZuvB6NyA/oA/+Emole1aH9KSZtsq0OhX8N29dZ24oSC5htahbEESWZA==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { "unlayer-types": "^1.33.0" } },

Why is it asking for react packages when I'm using it in angular? Should I install any other packages?

Thank you!

@IndikaWeerakoon
Copy link

IndikaWeerakoon commented Jan 31, 2025

I’m also facing the same issue after upgrading to [email protected] with @angular/[email protected]. The build fails due to missing React dependencies that required:

Error: node_modules/unlayer-types/embed.d.ts:2027:23 - error TS2307: Cannot find module 'react' or its corresponding type declarations.

2027     import React from 'react';
                           ~~~~~~~

My package-lock.json shows

"node_modules/angular-email-editor": {
      "version": "15.2.0",
      "resolved": "https://registry.npmjs.org/angular-email-editor/-/angular-email-editor-15.2.0.tgz",
      "integrity": "sha512-vi3LjMgL5uNRi0A59yPf4atJSzZNfrvZuvB6NyA/oA/+Emole1aH9KSZtsq0OhX8N29dZ24oSC5htahbEESWZA==",
      "dependencies": {
        "tslib": "^2.3.0"
      },
      "peerDependencies": {
        "unlayer-types": "latest"
      }
    },

It seems unlayer-types is requiring React types, even though this is an Angular project. Looking for a fix or workaround.

Hi @omerzahidbajwa, this issue appears to come from your PR merged in version 15.1.0. Disabling type checking for the entire project isn’t a viable solution. Looking for a proper fix or workaround.

Pull request: #133

@omerzahidbajwa
Copy link
Contributor

Hi, please pass on the following to bypass the typescript errors. (mentioned under readme)

{
"compilerOptions": {
"skipLibCheck": true,
}
}

@IndikaWeerakoon
Copy link

Hi, thanks for the suggestion! While skipLibCheck: true can be a temporary workaround, it’s not an ideal long-term solution since it disables type checking across the entire project, which might hide other potential issues.

The core problem is that angular-email-editor, which is meant for Angular, has a dependency on unlayer-types, which requires React types. It would be great if we could find a proper fix for this dependency issue instead of bypassing type checks.

Would love to hear if there's a planned update to address this. Thanks!

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

3 participants