Angular 9 - typeform embed: Module not found: Error: Can't resolve 'react'

637 views Asked by At

I'm trying to integrate typeform embed it with an angular 9 project.

I've installed typeform using NPM I referred to this https://developer.typeform.com/embed/

npm install --save @typeform/embed

then in my component.ts file I tried to test it.

import * as typeformEmbed from '@typeform/embed';

export class MyComponent {
  ...
  initTypeform() {
    console.log(typeformEmbed)
  }
}

in my terminal I get this error:

Module not found: Error: Can't resolve 'react' in '/app/node_modules/@typeform/embed/build'
ERROR in ./node_modules/@typeform/embed/build/lib.pure.js
Module not found: Error: Can't resolve 'react-dom' in '/app/node_modules/@typeform/embed/build'
1

There are 1 answers

0
Evan On

so I was able to make it work by installing react & react-dom to my Angular 9 project dependencies.

npm i react

&

npm i react-dom