Closed
Description
What I did:
- At the root of the project,
npm install
cd fluent-gecko
make fluent-react.js
I got an error message:
/Applications/Xcode.app/Contents/Developer/usr/bin/make -sC ../fluent-react compile
src/context.ts:1:31 - error TS2307: Cannot find module 'react' or its corresponding type declarations.
1 import { createContext } from "react";
~~~~~~~
src/localization.ts:1:46 - error TS2307: Cannot find module '@fluent/bundle' or its corresponding type declarations.
1 import { FluentBundle, FluentVariable } from "@fluent/bundle";
~~~~~~~~~~~~~~~~
src/localization.ts:2:31 - error TS2307: Cannot find module '@fluent/sequence' or its corresponding type declarations.
2 import { mapBundleSync } from "@fluent/sequence";
~~~~~~~~~~~~~~~~~~
src/localized.ts:9:8 - error TS2307: Cannot find module 'react' or its corresponding type declarations.
9 } from "react";
~~~~~~~
src/localized.ts:10:23 - error TS2307: Cannot find module 'prop-types' or its corresponding type declarations.
10 import PropTypes from "prop-types";
~~~~~~~~~~~~
src/localized.ts:13:32 - error TS2307: Cannot find module '@fluent/bundle' or its corresponding type declarations.
13 import { FluentVariable } from "@fluent/bundle";
~~~~~~~~~~~~~~~~
src/localized.ts:150:51 - error TS7006: Parameter 'childNode' implicitly has an 'any' type.
150 const translatedChildren = translationNodes.map(childNode => {
~~~~~~~~~
src/provider.ts:1:56 - error TS2307: Cannot find module 'react' or its corresponding type declarations.
1 import { createElement, ReactNode, ReactElement } from "react";
~~~~~~~
src/provider.ts:2:23 - error TS2307: Cannot find module 'prop-types' or its corresponding type declarations.
2 import PropTypes from "prop-types";
~~~~~~~~~~~~
src/use_localization.ts:1:28 - error TS2307: Cannot find module 'react' or its corresponding type declarations.
1 import { useContext } from "react";
~~~~~~~
src/with_localization.ts:1:72 - error TS2307: Cannot find module 'react' or its corresponding type declarations.
1 import { createElement, useContext, ComponentType, ReactElement } from "react";
~~~~~~~
src/with_localization.ts:3:32 - error TS2307: Cannot find module '@fluent/bundle' or its corresponding type declarations.
3 import { FluentVariable } from "@fluent/bundle";
~~~~~~~~~~~~~~~~
Found 12 errors.
make[1]: *** [esm/.compiled] Error 2
make: *** [fluent-react.js] Error 2
After some search, I found that I needed npm i -D @types/react
to get rid of the react ts errors,
and doing an npm install
from the fluent-react
folder eliminated all the errors.
It would be great if I wouldn't have to run those different commands that could be done directly within make fluent-react.js